├── .github └── workflows │ └── pythonpackage.yml ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── noxfile.py ├── poetry.lock ├── py_ts_interfaces ├── __init__.py ├── cli.py ├── parser.py ├── py.typed └── tests │ ├── __init__.py │ ├── tests.py │ └── utils.py ├── pyproject.toml ├── run_tests.sh ├── setup.cfg └── stubs └── astroid ├── __init__.pyi ├── __pkginfo__.pyi ├── _ast.pyi ├── arguments.pyi ├── as_string.pyi ├── bases.pyi ├── builder.pyi ├── context.pyi ├── decorators.pyi ├── exceptions.pyi ├── helpers.pyi ├── inference.pyi ├── interpreter ├── __init__.pyi ├── _import │ ├── __init__.pyi │ ├── spec.pyi │ └── util.pyi ├── dunder_lookup.pyi └── objectmodel.pyi ├── manager.pyi ├── mixins.pyi ├── modutils.pyi ├── node_classes.pyi ├── nodes.pyi ├── objects.pyi ├── protocols.pyi ├── raw_building.pyi ├── rebuilder.pyi ├── scoped_nodes.pyi ├── test_utils.pyi ├── transforms.pyi └── util.pyi /.github/workflows/pythonpackage.yml: -------------------------------------------------------------------------------- 1 | name: Continuous Integration 2 | on: 3 | pull_request: 4 | types: [assigned, opened, synchronize, reopened] 5 | workflow_dispatch: 6 | push: 7 | branches: 8 | - master 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | strategy: 14 | matrix: 15 | python-version: ["3.7", "3.8", "3.9", "3.10"] 16 | steps: 17 | - uses: actions/checkout@v2 18 | - name: Set up Python ${{ matrix.python-version }} 19 | uses: actions/setup-python@v1 20 | with: 21 | python-version: ${{ matrix.python-version }} 22 | - name: Install dependencies 23 | run: | 24 | curl -sSL https://install.python-poetry.org | python 25 | python -m pip install --upgrade pip 26 | $HOME/.local/bin/poetry install 27 | - name: Run test suite 28 | run: | 29 | $HOME/.local/bin/poetry run ./run_tests.sh 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.egg-info/ 2 | *.pyc 3 | .cache 4 | .coverage 5 | .mypy_cache 6 | .pytest_cache 7 | __pycache__ 8 | build/ 9 | dist/ 10 | .vscode/ 11 | .idea 12 | .python-version 13 | requirements.txt 14 | *.ts 15 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | If you're here, that means you're either me in the future, or you're actually someone who wants to help improve this project! I'm so glad you're here. 4 | 5 | ## Getting Setup 6 | 7 | This project relies on [pyenv](https://github.com/pyenv/pyenv) for managing Python versions and [Poetry](https://python-poetry.org/) for managing dependencies (and publishing). 8 | 9 | Check out their documentation respectively to get set up for your system. Once they're set up, pull down this respository and you can get started right away. 10 | 11 | ```shell 12 | $ cd /path/to/where/you/want/this/project 13 | $ git clone https://github.com/cs-cordero/py-ts-interfaces 14 | $ cd py-ts-interfaces 15 | $ 16 | $ pyenv local [at least 3.7.2] 17 | $ poetry install 18 | ``` 19 | 20 | From here, you're good to go! 21 | 22 | ## Running tests 23 | 24 | ### Unit tests for your current Python package 25 | 26 | There is a helpful shell script called [run_tests.sh](./run_tests.sh) that will execute all tests: code quality, type checking, and pytests. 27 | 28 | ```shell 29 | $ poetry run ./run_tests.sh 30 | ``` 31 | 32 | This will only run the test suite for your current Python package. It's a quick way to check that you're on the right track, though. 33 | 34 | Poetry has [facilities for switching Python versions if you've got them installed on your computer](https://python-poetry.org/docs/managing-environments/#switching-between-environments). See their documentation for how that works. Once you swap environments, you can just re-run the shell script. 35 | 36 | ### Nox tests 37 | 38 | This package uses [nox](https://nox.thea.codes/en/stable/index.html) for executing the test suite against all supported python versions. Its configuration is found in the [noxfile.py](./noxfile.py). 39 | 40 | ```shell 41 | $ poetry run nox 42 | ``` 43 | 44 | There are some setup details you'll need to remember to do before `nox` can run successfully. Specifically, your computer needs to have the supported Python minor versions installed. See the [noxfile.py](./noxfile.py) for the full list of supported python versions. 45 | 46 | ```shell 47 | $ pyenv install 3.7.x # replace x with the latest patch version 48 | $ pyenv install 3.8.x 49 | $ # ...rest of the supported versions... 50 | $ 51 | $ pyenv local 3.9.x 3.8.x 3.7.x 52 | $ poetry run nox 53 | ``` 54 | 55 | ### Continuous Integration 56 | 57 | This project leverages GitHub Actions for continuous integration tests, meaning once you make a pull request, it'll run the test suite for supported python versions right there in the PR. The configuration for the github action is at [./.github/workflows/pythonpackage.yml](./.github/workflows/pythonpackage.yml). 58 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Christopher Sabater Cordero 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # py-ts-interfaces 2 | ### Python to TypeScript Interfaces 3 | 4 | ![MIT License](https://img.shields.io/github/license/cs-cordero/py-ts-interfaces) 5 | ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/cs-cordero/py-ts-interfaces/pythonpackage.yml?branch=master) 6 | ![PyPI](https://img.shields.io/pypi/v/py-ts-interfaces) 7 | 8 | ## What is this? 9 | 10 | This library provides utilities that convert Python dataclasses with type 11 | annotations to a TypeScript `interface` and serializes them to a file. 12 | 13 | ## py-ts-interfaces is READ-ONLY. 14 | 15 | I no longer have the time to maintain this project. As a result, I am archiving the repository. Teams who wish to use this project are free to do so and also free to fork if you'd like. 16 | 17 | 18 | ## Installation 19 | 20 | ``` 21 | python --version # requires 3.7+ 22 | pip install py-ts-interfaces 23 | ``` 24 | 25 | ## Motivation 26 | 27 | In web applications where Python is used in the backend and TypeScript is used 28 | in the frontend, it is often the case that the client will make calls to the 29 | backend to request some data with some specific pre-defined "shape". On the 30 | client-side, an `interface` for this data is usually defined and if the Python 31 | backend authors use typechecking, like with [mypy](http://mypy-lang.org/), the 32 | project authors may be typing the JSON response values as well. 33 | 34 | This results in a duplication of code. If the shape changes in the backend, 35 | the related interface must also be reflect its changes in the frontend. At 36 | best, this is annoying to maintain. At worst, over time the interfaces may 37 | diverge and cause bugs. 38 | 39 | This library aims to have a single source of truth that describes the shape of 40 | the payload between the backend and the frontend. 41 | 42 | ## Usage 43 | 44 | In Python, `py-ts-interfaces` exposes a new class object called `Interface`. 45 | By subclassing this object, you identify to the also-packaged script that you 46 | want it to be serialized to an interface file. 47 | 48 | 1. First, hook up your dataclasses: 49 | 50 | ```python 51 | # views.py 52 | from dataclasses import dataclass 53 | from py_ts_interfaces import Interface 54 | 55 | @dataclass 56 | class MyComponentProps(Interface): 57 | name: str 58 | show: bool 59 | value: float 60 | 61 | @dataclass 62 | class WillNotGetPickedUp: # this doesn't subclass Interface, so it won't be included 63 | name: str 64 | value: float 65 | ``` 66 | 67 | 2. In your shell, run the included command and pass in the name of the file or 68 | directory you want to use. By default it will output to a file in your 69 | directory called interface.ts 70 | ``` 71 | $ py-ts-interfaces views.py 72 | Created interface.ts! 73 | ``` 74 | 75 | You may also use the following arguments: 76 | * `-o, --output [filepath]`: where the file will be saved. default is `interface.ts`. 77 | * `-a, --append`: by default each run will overwrite the output file. this flag 78 | allows only appends. Be warned, duplicate interfaces are not tested. 79 | 80 | 81 | 3. The resulting file will look like this: 82 | ```typescript 83 | // interface.ts 84 | interface MyComponentProps { 85 | name: string; 86 | show: boolean; 87 | value: number; 88 | } 89 | ``` 90 | 91 | ## Why @dataclass? 92 | 93 | `Dataclass`es were introduced in Python 3.7 and they are great. Some 94 | alternatives that I have seen other codebases using are `NamedTuple` and 95 | `TypedDict`. All of these objects attempt to do the same thing: group together 96 | pieces of data that belong close together like a struct. 97 | 98 | However, `dataclass` won out over the other two for the following reasons: 99 | 1. dataclasses are built-in to Python. As of writing, `NamedTuple` is also 100 | built-in to the `typing` module, but `TypedDict` is still considered 101 | experimental. 102 | 2. dataclasses cannot be declared and defined inline like you can do with 103 | `NamedTuple` and `TypedDict`, e.g., `NamedTuple` can be defined using class 104 | inheritance like `class MyNamedTuple(NamedTuple): ...`, but also like 105 | `MyNamedTuple = NamedTuple('MyNamedTuple', [('name', str), ('id', int)])`. 106 | This is a good thing. Dataclasses require you to use a class style 107 | declaration, which not only looks closer to a TypeScript interface 108 | declaration, but it avoids the complex metaclass machinery that NamedTuples 109 | and TypedDicts use to gain all its features. Since this library uses the 110 | AST and static analysis of the code to determine what data to serialize, 111 | this makes the choice a no-brainer. 112 | 3. dataclasses can be made to be immutable (mostly) by setting `frozen=True`. 113 | This library does not require it but in later versions we may provide a 114 | `partial`ed dataclass decorator that guarantees immutability. 115 | 4. Because we avoid the metaclass machinery of NamedTuples and TypedDicts, it 116 | opens up the possibility of writing custom classes that allows `mypy` to 117 | typecheck it one way, but gives the AST parser some clues in order to 118 | generate TypeScript types that cannot easily be expressed in Python. 119 | 120 | ## Why define the types in Python instead of TypeScript? 121 | 122 | TypeScript is significantly more mature for typing syntax than Python. 123 | Generally speaking, you can express any type that Python can do in TypeScript, 124 | but _not_ vice versa. 125 | 126 | So defining the types in Python guarantee that you can also express the whole 127 | interface in both languages. 128 | 129 | ## Supported Type Mappings 130 | Please note that usage of `T` `U` and `V` in the table below represent 131 | stand-ins for actual types. They do not represent actually using generic typed 132 | variables. 133 | 134 | | Python | Typescript | 135 | |:-------------------------------:|:-----------------------------:| 136 | | None | null | 137 | | str | string | 138 | | int | number | 139 | | float | number | 140 | | complex | number | 141 | | bool | boolean | 142 | | List | Array\ | 143 | | Tuple | [any] | 144 | | Dict | Record | 145 | | List[T] | Array[T] | 146 | | Tuple[T, U] | [T, U] | 147 | | Dict[T, U] | Record | 148 | | Optional[T] | T \| null | 149 | | Union[T, U, V] | T \| U \| V | 150 | 151 | ## Planned Supported Mappings 152 | 153 | * String literals 154 | * Undefined type 155 | * isNaN type 156 | * ReadOnly types 157 | * Excess Properties 158 | 159 | ## Unsupported/Rejected Mappings 160 | 161 | The primary purpose of this library is to help type, first and foremost, _data_ 162 | moving back and forth from client to server. Many of these features, whether they be specific to TypeScript or Python, would be overkill to support. 163 | 164 | * void 165 | * callables/functions 166 | * enums 167 | * Dates, datetime, dates, times (send these over as strings and convert them to richer objects on the client) 168 | * extends 169 | * generics, TypeVars 170 | * intersection types 171 | * mapped types 172 | * conditional types 173 | * classes 174 | 175 | ## Contributing 176 | 177 | Interested in contributing? You're awesome! It's not much, but here's some notes to get you started [CONTRIBUTING.md](CONTRIBUTING.md). 178 | 179 | ## Author 180 | 181 | [Christopher Sabater Cordero](https://chrisdoescoding.com) 182 | -------------------------------------------------------------------------------- /noxfile.py: -------------------------------------------------------------------------------- 1 | from functools import wraps 2 | from typing import TypeVar, Callable, Any, cast 3 | 4 | from nox_poetry import session as nox_session 5 | from nox_poetry import Session 6 | 7 | 8 | SUPPORTED_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10"] 9 | 10 | F = TypeVar("F", bound=Callable[..., Any]) 11 | 12 | 13 | def install_poetry_deps(fn: F) -> F: 14 | @wraps(fn) 15 | def wrapper(session: Session, *args, **kwargs): 16 | session.install("-r", str(session.poetry.export_requirements())) 17 | return fn(session, *args, **kwargs) 18 | return cast(F, wrapper) 19 | 20 | 21 | @nox_session(python=SUPPORTED_PYTHON_VERSIONS) 22 | @install_poetry_deps 23 | def code_quality(session: Session) -> None: 24 | session.run("black", "--check", "py_ts_interfaces") 25 | session.run("flake8", "--count", "py_ts_interfaces") 26 | session.run("isort", "-c", "py_ts_interfaces") 27 | 28 | 29 | @nox_session(python=SUPPORTED_PYTHON_VERSIONS) 30 | @install_poetry_deps 31 | def type_check(session: Session) -> None: 32 | session.run("mypy", "py_ts_interfaces") 33 | 34 | 35 | @nox_session(python=SUPPORTED_PYTHON_VERSIONS) 36 | @install_poetry_deps 37 | def pytests(session: Session) -> None: 38 | session.run("python", "-m", "pytest") 39 | -------------------------------------------------------------------------------- /poetry.lock: -------------------------------------------------------------------------------- 1 | [[package]] 2 | name = "argcomplete" 3 | version = "1.12.3" 4 | description = "Bash tab completion for argparse" 5 | category = "dev" 6 | optional = false 7 | python-versions = "*" 8 | 9 | [package.dependencies] 10 | importlib-metadata = {version = ">=0.23,<5", markers = "python_version == \"3.7\""} 11 | 12 | [package.extras] 13 | test = ["coverage", "flake8", "pexpect", "wheel"] 14 | 15 | [[package]] 16 | name = "astroid" 17 | version = "2.14.2" 18 | description = "An abstract syntax tree for Python with inference support." 19 | category = "main" 20 | optional = false 21 | python-versions = ">=3.7.2" 22 | 23 | [package.dependencies] 24 | lazy-object-proxy = ">=1.4.0" 25 | typed-ast = {version = ">=1.4.0,<2.0", markers = "implementation_name == \"cpython\" and python_version < \"3.8\""} 26 | typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} 27 | wrapt = [ 28 | {version = ">=1.11,<2", markers = "python_version < \"3.11\""}, 29 | {version = ">=1.14,<2", markers = "python_version >= \"3.11\""}, 30 | ] 31 | 32 | [[package]] 33 | name = "attrs" 34 | version = "22.2.0" 35 | description = "Classes Without Boilerplate" 36 | category = "dev" 37 | optional = false 38 | python-versions = ">=3.6" 39 | 40 | [package.extras] 41 | cov = ["attrs", "coverage-enable-subprocess", "coverage[toml] (>=5.3)"] 42 | dev = ["attrs"] 43 | docs = ["furo", "sphinx", "myst-parser", "zope.interface", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier"] 44 | tests = ["attrs", "zope.interface"] 45 | tests-no-zope = ["hypothesis", "pympler", "pytest (>=4.3.0)", "pytest-xdist", "cloudpickle", "mypy (>=0.971,<0.990)", "pytest-mypy-plugins"] 46 | tests_no_zope = ["hypothesis", "pympler", "pytest (>=4.3.0)", "pytest-xdist", "cloudpickle", "mypy (>=0.971,<0.990)", "pytest-mypy-plugins"] 47 | 48 | [[package]] 49 | name = "black" 50 | version = "22.6.0" 51 | description = "The uncompromising code formatter." 52 | category = "dev" 53 | optional = false 54 | python-versions = ">=3.6.2" 55 | 56 | [package.dependencies] 57 | click = ">=8.0.0" 58 | mypy-extensions = ">=0.4.3" 59 | pathspec = ">=0.9.0" 60 | platformdirs = ">=2" 61 | tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.11.0a7\""} 62 | typed-ast = {version = ">=1.4.2", markers = "python_version < \"3.8\" and implementation_name == \"cpython\""} 63 | typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} 64 | 65 | [package.extras] 66 | colorama = ["colorama (>=0.4.3)"] 67 | d = ["aiohttp (>=3.7.4)"] 68 | jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] 69 | uvloop = ["uvloop (>=0.15.2)"] 70 | 71 | [[package]] 72 | name = "click" 73 | version = "8.1.3" 74 | description = "Composable command line interface toolkit" 75 | category = "dev" 76 | optional = false 77 | python-versions = ">=3.7" 78 | 79 | [package.dependencies] 80 | colorama = {version = "*", markers = "platform_system == \"Windows\""} 81 | importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} 82 | 83 | [[package]] 84 | name = "colorama" 85 | version = "0.4.6" 86 | description = "Cross-platform colored terminal text." 87 | category = "dev" 88 | optional = false 89 | python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" 90 | 91 | [[package]] 92 | name = "colorlog" 93 | version = "6.7.0" 94 | description = "Add colours to the output of Python's logging module." 95 | category = "dev" 96 | optional = false 97 | python-versions = ">=3.6" 98 | 99 | [package.dependencies] 100 | colorama = {version = "*", markers = "sys_platform == \"win32\""} 101 | 102 | [package.extras] 103 | development = ["black", "flake8", "mypy", "pytest", "types-colorama"] 104 | 105 | [[package]] 106 | name = "coverage" 107 | version = "7.1.0" 108 | description = "Code coverage measurement for Python" 109 | category = "dev" 110 | optional = false 111 | python-versions = ">=3.7" 112 | 113 | [package.dependencies] 114 | tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""} 115 | 116 | [package.extras] 117 | toml = ["tomli"] 118 | 119 | [[package]] 120 | name = "distlib" 121 | version = "0.3.6" 122 | description = "Distribution utilities" 123 | category = "dev" 124 | optional = false 125 | python-versions = "*" 126 | 127 | [[package]] 128 | name = "exceptiongroup" 129 | version = "1.1.0" 130 | description = "Backport of PEP 654 (exception groups)" 131 | category = "dev" 132 | optional = false 133 | python-versions = ">=3.7" 134 | 135 | [package.extras] 136 | test = ["pytest (>=6)"] 137 | 138 | [[package]] 139 | name = "filelock" 140 | version = "3.9.0" 141 | description = "A platform independent file lock." 142 | category = "dev" 143 | optional = false 144 | python-versions = ">=3.7" 145 | 146 | [package.extras] 147 | docs = ["furo (>=2022.12.7)", "sphinx-autodoc-typehints (>=1.19.5)", "sphinx (>=5.3)"] 148 | testing = ["covdefaults (>=2.2.2)", "coverage (>=7.0.1)", "pytest-cov (>=4)", "pytest-timeout (>=2.1)", "pytest (>=7.2)"] 149 | 150 | [[package]] 151 | name = "flake8" 152 | version = "4.0.1" 153 | description = "the modular source code checker: pep8 pyflakes and co" 154 | category = "dev" 155 | optional = false 156 | python-versions = ">=3.6" 157 | 158 | [package.dependencies] 159 | importlib-metadata = {version = "<4.3", markers = "python_version < \"3.8\""} 160 | mccabe = ">=0.6.0,<0.7.0" 161 | pycodestyle = ">=2.8.0,<2.9.0" 162 | pyflakes = ">=2.4.0,<2.5.0" 163 | 164 | [[package]] 165 | name = "importlib-metadata" 166 | version = "4.2.0" 167 | description = "Read metadata from Python packages" 168 | category = "dev" 169 | optional = false 170 | python-versions = ">=3.6" 171 | 172 | [package.dependencies] 173 | typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} 174 | zipp = ">=0.5" 175 | 176 | [package.extras] 177 | docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] 178 | testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"] 179 | 180 | [[package]] 181 | name = "iniconfig" 182 | version = "2.0.0" 183 | description = "brain-dead simple config-ini parsing" 184 | category = "dev" 185 | optional = false 186 | python-versions = ">=3.7" 187 | 188 | [[package]] 189 | name = "isort" 190 | version = "5.11.5" 191 | description = "A Python utility / library to sort Python imports." 192 | category = "dev" 193 | optional = false 194 | python-versions = ">=3.7.0" 195 | 196 | [package.extras] 197 | pipfile-deprecated-finder = ["pipreqs", "requirementslib", "pip-shims (>=0.5.2)"] 198 | requirements-deprecated-finder = ["pipreqs", "pip-api"] 199 | colors = ["colorama (>=0.4.3,<0.5.0)"] 200 | plugins = ["setuptools"] 201 | 202 | [[package]] 203 | name = "isort" 204 | version = "5.12.0" 205 | description = "A Python utility / library to sort Python imports." 206 | category = "dev" 207 | optional = false 208 | python-versions = ">=3.8.0" 209 | 210 | [package.extras] 211 | colors = ["colorama (>=0.4.3)"] 212 | requirements-deprecated-finder = ["pip-api", "pipreqs"] 213 | pipfile-deprecated-finder = ["pip-shims (>=0.5.2)", "pipreqs", "requirementslib"] 214 | plugins = ["setuptools"] 215 | 216 | [[package]] 217 | name = "lazy-object-proxy" 218 | version = "1.9.0" 219 | description = "A fast and thorough lazy object proxy." 220 | category = "main" 221 | optional = false 222 | python-versions = ">=3.7" 223 | 224 | [[package]] 225 | name = "mccabe" 226 | version = "0.6.1" 227 | description = "McCabe checker, plugin for flake8" 228 | category = "dev" 229 | optional = false 230 | python-versions = "*" 231 | 232 | [[package]] 233 | name = "mypy" 234 | version = "1.0.0" 235 | description = "Optional static typing for Python" 236 | category = "dev" 237 | optional = false 238 | python-versions = ">=3.7" 239 | 240 | [package.dependencies] 241 | mypy-extensions = ">=0.4.3" 242 | tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} 243 | typed-ast = {version = ">=1.4.0,<2", markers = "python_version < \"3.8\""} 244 | typing-extensions = ">=3.10" 245 | 246 | [package.extras] 247 | dmypy = ["psutil (>=4.0)"] 248 | install-types = ["pip"] 249 | python2 = ["typed-ast (>=1.4.0,<2)"] 250 | reports = ["lxml"] 251 | 252 | [[package]] 253 | name = "mypy-extensions" 254 | version = "1.0.0" 255 | description = "Type system extensions for programs checked with the mypy type checker." 256 | category = "dev" 257 | optional = false 258 | python-versions = ">=3.5" 259 | 260 | [[package]] 261 | name = "nox" 262 | version = "2022.1.7" 263 | description = "Flexible test automation." 264 | category = "dev" 265 | optional = false 266 | python-versions = ">=3.6" 267 | 268 | [package.dependencies] 269 | argcomplete = ">=1.9.4,<2.0" 270 | colorlog = ">=2.6.1,<7.0.0" 271 | importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} 272 | packaging = ">=20.9" 273 | py = ">=1.4.0,<2.0.0" 274 | typing-extensions = {version = ">=3.7.4", markers = "python_version < \"3.8\""} 275 | virtualenv = ">=14.0.0" 276 | 277 | [package.extras] 278 | tox_to_nox = ["jinja2", "tox"] 279 | 280 | [[package]] 281 | name = "nox-poetry" 282 | version = "1.0.1" 283 | description = "nox-poetry" 284 | category = "dev" 285 | optional = false 286 | python-versions = ">=3.7,<4.0" 287 | 288 | [package.dependencies] 289 | nox = ">=2020.8.22" 290 | packaging = ">=20.9" 291 | tomlkit = ">=0.7" 292 | 293 | [[package]] 294 | name = "packaging" 295 | version = "23.0" 296 | description = "Core utilities for Python packages" 297 | category = "dev" 298 | optional = false 299 | python-versions = ">=3.7" 300 | 301 | [[package]] 302 | name = "pathspec" 303 | version = "0.11.0" 304 | description = "Utility library for gitignore style pattern matching of file paths." 305 | category = "dev" 306 | optional = false 307 | python-versions = ">=3.7" 308 | 309 | [[package]] 310 | name = "platformdirs" 311 | version = "2.6.2" 312 | description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." 313 | category = "dev" 314 | optional = false 315 | python-versions = ">=3.7" 316 | 317 | [package.dependencies] 318 | typing-extensions = {version = ">=4.4", markers = "python_version < \"3.8\""} 319 | 320 | [package.extras] 321 | docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx-autodoc-typehints (>=1.19.5)", "sphinx (>=5.3)"] 322 | test = ["appdirs (==1.4.4)", "covdefaults (>=2.2.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)", "pytest (>=7.2)"] 323 | 324 | [[package]] 325 | name = "pluggy" 326 | version = "1.0.0" 327 | description = "plugin and hook calling mechanisms for python" 328 | category = "dev" 329 | optional = false 330 | python-versions = ">=3.6" 331 | 332 | [package.dependencies] 333 | importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} 334 | 335 | [package.extras] 336 | dev = ["pre-commit", "tox"] 337 | testing = ["pytest", "pytest-benchmark"] 338 | 339 | [[package]] 340 | name = "py" 341 | version = "1.11.0" 342 | description = "library with cross-python path, ini-parsing, io, code, log facilities" 343 | category = "dev" 344 | optional = false 345 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 346 | 347 | [[package]] 348 | name = "pycodestyle" 349 | version = "2.8.0" 350 | description = "Python style guide checker" 351 | category = "dev" 352 | optional = false 353 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 354 | 355 | [[package]] 356 | name = "pyflakes" 357 | version = "2.4.0" 358 | description = "passive checker of Python programs" 359 | category = "dev" 360 | optional = false 361 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 362 | 363 | [[package]] 364 | name = "pytest" 365 | version = "7.2.1" 366 | description = "pytest: simple powerful testing with Python" 367 | category = "dev" 368 | optional = false 369 | python-versions = ">=3.7" 370 | 371 | [package.dependencies] 372 | attrs = ">=19.2.0" 373 | colorama = {version = "*", markers = "sys_platform == \"win32\""} 374 | exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} 375 | importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} 376 | iniconfig = "*" 377 | packaging = "*" 378 | pluggy = ">=0.12,<2.0" 379 | tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} 380 | 381 | [package.extras] 382 | testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"] 383 | 384 | [[package]] 385 | name = "pytest-cov" 386 | version = "4.0.0" 387 | description = "Pytest plugin for measuring coverage." 388 | category = "dev" 389 | optional = false 390 | python-versions = ">=3.6" 391 | 392 | [package.dependencies] 393 | coverage = {version = ">=5.2.1", extras = ["toml"]} 394 | pytest = ">=4.6" 395 | 396 | [package.extras] 397 | testing = ["fields", "hunter", "process-tests", "six", "pytest-xdist", "virtualenv"] 398 | 399 | [[package]] 400 | name = "tomli" 401 | version = "2.0.1" 402 | description = "A lil' TOML parser" 403 | category = "dev" 404 | optional = false 405 | python-versions = ">=3.7" 406 | 407 | [[package]] 408 | name = "tomlkit" 409 | version = "0.11.6" 410 | description = "Style preserving TOML library" 411 | category = "dev" 412 | optional = false 413 | python-versions = ">=3.6" 414 | 415 | [[package]] 416 | name = "typed-ast" 417 | version = "1.5.4" 418 | description = "a fork of Python 2 and 3 ast modules with type comment support" 419 | category = "main" 420 | optional = false 421 | python-versions = ">=3.6" 422 | 423 | [[package]] 424 | name = "typing-extensions" 425 | version = "4.4.0" 426 | description = "Backported and Experimental Type Hints for Python 3.7+" 427 | category = "main" 428 | optional = false 429 | python-versions = ">=3.7" 430 | 431 | [[package]] 432 | name = "virtualenv" 433 | version = "20.16.2" 434 | description = "Virtual Python Environment builder" 435 | category = "dev" 436 | optional = false 437 | python-versions = ">=3.6" 438 | 439 | [package.dependencies] 440 | distlib = ">=0.3.1,<1" 441 | filelock = ">=3.2,<4" 442 | importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} 443 | platformdirs = ">=2,<3" 444 | 445 | [package.extras] 446 | docs = ["proselint (>=0.10.2)", "sphinx (>=3)", "sphinx-argparse (>=0.2.5)", "sphinx-rtd-theme (>=0.4.3)", "towncrier (>=21.3)"] 447 | testing = ["coverage (>=4)", "coverage-enable-subprocess (>=1)", "flaky (>=3)", "packaging (>=20.0)", "pytest (>=4)", "pytest-env (>=0.6.2)", "pytest-freezegun (>=0.4.1)", "pytest-mock (>=2)", "pytest-randomly (>=1)", "pytest-timeout (>=1)"] 448 | 449 | [[package]] 450 | name = "wrapt" 451 | version = "1.14.1" 452 | description = "Module for decorators, wrappers and monkey patching." 453 | category = "main" 454 | optional = false 455 | python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" 456 | 457 | [[package]] 458 | name = "zipp" 459 | version = "3.13.0" 460 | description = "Backport of pathlib-compatible object wrapper for zip files" 461 | category = "dev" 462 | optional = false 463 | python-versions = ">=3.7" 464 | 465 | [package.extras] 466 | docs = ["sphinx (>=3.5)", "jaraco.packaging (>=9)", "rst.linker (>=1.9)", "furo", "sphinx-lint", "jaraco.tidelift (>=1.4)"] 467 | testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "flake8 (<5)", "pytest-cov", "pytest-enabler (>=1.3)", "jaraco.itertools", "func-timeout", "jaraco.functools", "more-itertools", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)", "pytest-flake8"] 468 | 469 | [metadata] 470 | lock-version = "1.1" 471 | python-versions = '^3.7.2' 472 | content-hash = "5b44e8d4bb9e5cf881abdbe4e447fb44fced6bdbd268a6aa5c486629a6563872" 473 | 474 | [metadata.files] 475 | argcomplete = [] 476 | astroid = [ 477 | {file = "astroid-2.14.2-py3-none-any.whl", hash = "sha256:0e0e3709d64fbffd3037e4ff403580550f14471fd3eaae9fa11cc9a5c7901153"}, 478 | {file = "astroid-2.14.2.tar.gz", hash = "sha256:a3cf9f02c53dd259144a7e8f3ccd75d67c9a8c716ef183e0c1f291bc5d7bb3cf"}, 479 | ] 480 | attrs = [ 481 | {file = "attrs-22.2.0-py3-none-any.whl", hash = "sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836"}, 482 | {file = "attrs-22.2.0.tar.gz", hash = "sha256:c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99"}, 483 | ] 484 | black = [] 485 | click = [] 486 | colorama = [ 487 | {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, 488 | {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, 489 | ] 490 | colorlog = [ 491 | {file = "colorlog-6.7.0-py2.py3-none-any.whl", hash = "sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662"}, 492 | {file = "colorlog-6.7.0.tar.gz", hash = "sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5"}, 493 | ] 494 | coverage = [ 495 | {file = "coverage-7.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:3b946bbcd5a8231383450b195cfb58cb01cbe7f8949f5758566b881df4b33baf"}, 496 | {file = "coverage-7.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ec8e767f13be637d056f7e07e61d089e555f719b387a7070154ad80a0ff31801"}, 497 | {file = "coverage-7.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d4a5a5879a939cb84959d86869132b00176197ca561c664fc21478c1eee60d75"}, 498 | {file = "coverage-7.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b643cb30821e7570c0aaf54feaf0bfb630b79059f85741843e9dc23f33aaca2c"}, 499 | {file = "coverage-7.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:32df215215f3af2c1617a55dbdfb403b772d463d54d219985ac7cd3bf124cada"}, 500 | {file = "coverage-7.1.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:33d1ae9d4079e05ac4cc1ef9e20c648f5afabf1a92adfaf2ccf509c50b85717f"}, 501 | {file = "coverage-7.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:29571503c37f2ef2138a306d23e7270687c0efb9cab4bd8038d609b5c2393a3a"}, 502 | {file = "coverage-7.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:63ffd21aa133ff48c4dff7adcc46b7ec8b565491bfc371212122dd999812ea1c"}, 503 | {file = "coverage-7.1.0-cp310-cp310-win32.whl", hash = "sha256:4b14d5e09c656de5038a3f9bfe5228f53439282abcab87317c9f7f1acb280352"}, 504 | {file = "coverage-7.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:8361be1c2c073919500b6601220a6f2f98ea0b6d2fec5014c1d9cfa23dd07038"}, 505 | {file = "coverage-7.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:da9b41d4539eefd408c46725fb76ecba3a50a3367cafb7dea5f250d0653c1040"}, 506 | {file = "coverage-7.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c5b15ed7644ae4bee0ecf74fee95808dcc34ba6ace87e8dfbf5cb0dc20eab45a"}, 507 | {file = "coverage-7.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d12d076582507ea460ea2a89a8c85cb558f83406c8a41dd641d7be9a32e1274f"}, 508 | {file = "coverage-7.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e2617759031dae1bf183c16cef8fcfb3de7617f394c813fa5e8e46e9b82d4222"}, 509 | {file = "coverage-7.1.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c4e4881fa9e9667afcc742f0c244d9364d197490fbc91d12ac3b5de0bf2df146"}, 510 | {file = "coverage-7.1.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:9d58885215094ab4a86a6aef044e42994a2bd76a446dc59b352622655ba6621b"}, 511 | {file = "coverage-7.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:ffeeb38ee4a80a30a6877c5c4c359e5498eec095878f1581453202bfacc8fbc2"}, 512 | {file = "coverage-7.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3baf5f126f30781b5e93dbefcc8271cb2491647f8283f20ac54d12161dff080e"}, 513 | {file = "coverage-7.1.0-cp311-cp311-win32.whl", hash = "sha256:ded59300d6330be27bc6cf0b74b89ada58069ced87c48eaf9344e5e84b0072f7"}, 514 | {file = "coverage-7.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:6a43c7823cd7427b4ed763aa7fb63901ca8288591323b58c9cd6ec31ad910f3c"}, 515 | {file = "coverage-7.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:7a726d742816cb3a8973c8c9a97539c734b3a309345236cd533c4883dda05b8d"}, 516 | {file = "coverage-7.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bc7c85a150501286f8b56bd8ed3aa4093f4b88fb68c0843d21ff9656f0009d6a"}, 517 | {file = "coverage-7.1.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f5b4198d85a3755d27e64c52f8c95d6333119e49fd001ae5798dac872c95e0f8"}, 518 | {file = "coverage-7.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ddb726cb861c3117a553f940372a495fe1078249ff5f8a5478c0576c7be12050"}, 519 | {file = "coverage-7.1.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:51b236e764840a6df0661b67e50697aaa0e7d4124ca95e5058fa3d7cbc240b7c"}, 520 | {file = "coverage-7.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:7ee5c9bb51695f80878faaa5598040dd6c9e172ddcf490382e8aedb8ec3fec8d"}, 521 | {file = "coverage-7.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:c31b75ae466c053a98bf26843563b3b3517b8f37da4d47b1c582fdc703112bc3"}, 522 | {file = "coverage-7.1.0-cp37-cp37m-win32.whl", hash = "sha256:3b155caf3760408d1cb903b21e6a97ad4e2bdad43cbc265e3ce0afb8e0057e73"}, 523 | {file = "coverage-7.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:2a60d6513781e87047c3e630b33b4d1e89f39836dac6e069ffee28c4786715f5"}, 524 | {file = "coverage-7.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f2cba5c6db29ce991029b5e4ac51eb36774458f0a3b8d3137241b32d1bb91f06"}, 525 | {file = "coverage-7.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:beeb129cacea34490ffd4d6153af70509aa3cda20fdda2ea1a2be870dfec8d52"}, 526 | {file = "coverage-7.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0c45948f613d5d18c9ec5eaa203ce06a653334cf1bd47c783a12d0dd4fd9c851"}, 527 | {file = "coverage-7.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ef382417db92ba23dfb5864a3fc9be27ea4894e86620d342a116b243ade5d35d"}, 528 | {file = "coverage-7.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7c7c0d0827e853315c9bbd43c1162c006dd808dbbe297db7ae66cd17b07830f0"}, 529 | {file = "coverage-7.1.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:e5cdbb5cafcedea04924568d990e20ce7f1945a1dd54b560f879ee2d57226912"}, 530 | {file = "coverage-7.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:9817733f0d3ea91bea80de0f79ef971ae94f81ca52f9b66500c6a2fea8e4b4f8"}, 531 | {file = "coverage-7.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:218fe982371ac7387304153ecd51205f14e9d731b34fb0568181abaf7b443ba0"}, 532 | {file = "coverage-7.1.0-cp38-cp38-win32.whl", hash = "sha256:04481245ef966fbd24ae9b9e537ce899ae584d521dfbe78f89cad003c38ca2ab"}, 533 | {file = "coverage-7.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:8ae125d1134bf236acba8b83e74c603d1b30e207266121e76484562bc816344c"}, 534 | {file = "coverage-7.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2bf1d5f2084c3932b56b962a683074a3692bce7cabd3aa023c987a2a8e7612f6"}, 535 | {file = "coverage-7.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:98b85dd86514d889a2e3dd22ab3c18c9d0019e696478391d86708b805f4ea0fa"}, 536 | {file = "coverage-7.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:38da2db80cc505a611938d8624801158e409928b136c8916cd2e203970dde4dc"}, 537 | {file = "coverage-7.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3164d31078fa9efe406e198aecd2a02d32a62fecbdef74f76dad6a46c7e48311"}, 538 | {file = "coverage-7.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db61a79c07331e88b9a9974815c075fbd812bc9dbc4dc44b366b5368a2936063"}, 539 | {file = "coverage-7.1.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9ccb092c9ede70b2517a57382a601619d20981f56f440eae7e4d7eaafd1d1d09"}, 540 | {file = "coverage-7.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:33ff26d0f6cc3ca8de13d14fde1ff8efe1456b53e3f0273e63cc8b3c84a063d8"}, 541 | {file = "coverage-7.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:d47dd659a4ee952e90dc56c97d78132573dc5c7b09d61b416a9deef4ebe01a0c"}, 542 | {file = "coverage-7.1.0-cp39-cp39-win32.whl", hash = "sha256:d248cd4a92065a4d4543b8331660121b31c4148dd00a691bfb7a5cdc7483cfa4"}, 543 | {file = "coverage-7.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:7ed681b0f8e8bcbbffa58ba26fcf5dbc8f79e7997595bf071ed5430d8c08d6f3"}, 544 | {file = "coverage-7.1.0-pp37.pp38.pp39-none-any.whl", hash = "sha256:755e89e32376c850f826c425ece2c35a4fc266c081490eb0a841e7c1cb0d3bda"}, 545 | {file = "coverage-7.1.0.tar.gz", hash = "sha256:10188fe543560ec4874f974b5305cd1a8bdcfa885ee00ea3a03733464c4ca265"}, 546 | ] 547 | distlib = [ 548 | {file = "distlib-0.3.6-py2.py3-none-any.whl", hash = "sha256:f35c4b692542ca110de7ef0bea44d73981caeb34ca0b9b6b2e6d7790dda8f80e"}, 549 | {file = "distlib-0.3.6.tar.gz", hash = "sha256:14bad2d9b04d3a36127ac97f30b12a19268f211063d8f8ee4f47108896e11b46"}, 550 | ] 551 | exceptiongroup = [ 552 | {file = "exceptiongroup-1.1.0-py3-none-any.whl", hash = "sha256:327cbda3da756e2de031a3107b81ab7b3770a602c4d16ca618298c526f4bec1e"}, 553 | {file = "exceptiongroup-1.1.0.tar.gz", hash = "sha256:bcb67d800a4497e1b404c2dd44fca47d3b7a5e5433dbab67f96c1a685cdfdf23"}, 554 | ] 555 | filelock = [ 556 | {file = "filelock-3.9.0-py3-none-any.whl", hash = "sha256:f58d535af89bb9ad5cd4df046f741f8553a418c01a7856bf0d173bbc9f6bd16d"}, 557 | {file = "filelock-3.9.0.tar.gz", hash = "sha256:7b319f24340b51f55a2bf7a12ac0755a9b03e718311dac567a0f4f7fabd2f5de"}, 558 | ] 559 | flake8 = [ 560 | {file = "flake8-4.0.1-py2.py3-none-any.whl", hash = "sha256:479b1304f72536a55948cb40a32dce8bb0ffe3501e26eaf292c7e60eb5e0428d"}, 561 | {file = "flake8-4.0.1.tar.gz", hash = "sha256:806e034dda44114815e23c16ef92f95c91e4c71100ff52813adf7132a6ad870d"}, 562 | ] 563 | importlib-metadata = [] 564 | iniconfig = [ 565 | {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, 566 | {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, 567 | ] 568 | isort = [ 569 | {file = "isort-5.11.5-py3-none-any.whl", hash = "sha256:ba1d72fb2595a01c7895a5128f9585a5cc4b6d395f1c8d514989b9a7eb2a8746"}, 570 | {file = "isort-5.11.5.tar.gz", hash = "sha256:6be1f76a507cb2ecf16c7cf14a37e41609ca082330be4e3436a18ef74add55db"}, 571 | {file = "isort-5.12.0-py3-none-any.whl", hash = "sha256:f84c2818376e66cf843d497486ea8fed8700b340f308f076c6fb1229dff318b6"}, 572 | {file = "isort-5.12.0.tar.gz", hash = "sha256:8bef7dde241278824a6d83f44a544709b065191b95b6e50894bdc722fcba0504"}, 573 | ] 574 | lazy-object-proxy = [ 575 | {file = "lazy-object-proxy-1.9.0.tar.gz", hash = "sha256:659fb5809fa4629b8a1ac5106f669cfc7bef26fbb389dda53b3e010d1ac4ebae"}, 576 | {file = "lazy_object_proxy-1.9.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b40387277b0ed2d0602b8293b94d7257e17d1479e257b4de114ea11a8cb7f2d7"}, 577 | {file = "lazy_object_proxy-1.9.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8c6cfb338b133fbdbc5cfaa10fe3c6aeea827db80c978dbd13bc9dd8526b7d4"}, 578 | {file = "lazy_object_proxy-1.9.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:721532711daa7db0d8b779b0bb0318fa87af1c10d7fe5e52ef30f8eff254d0cd"}, 579 | {file = "lazy_object_proxy-1.9.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:66a3de4a3ec06cd8af3f61b8e1ec67614fbb7c995d02fa224813cb7afefee701"}, 580 | {file = "lazy_object_proxy-1.9.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:1aa3de4088c89a1b69f8ec0dcc169aa725b0ff017899ac568fe44ddc1396df46"}, 581 | {file = "lazy_object_proxy-1.9.0-cp310-cp310-win32.whl", hash = "sha256:f0705c376533ed2a9e5e97aacdbfe04cecd71e0aa84c7c0595d02ef93b6e4455"}, 582 | {file = "lazy_object_proxy-1.9.0-cp310-cp310-win_amd64.whl", hash = "sha256:ea806fd4c37bf7e7ad82537b0757999264d5f70c45468447bb2b91afdbe73a6e"}, 583 | {file = "lazy_object_proxy-1.9.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:946d27deaff6cf8452ed0dba83ba38839a87f4f7a9732e8f9fd4107b21e6ff07"}, 584 | {file = "lazy_object_proxy-1.9.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79a31b086e7e68b24b99b23d57723ef7e2c6d81ed21007b6281ebcd1688acb0a"}, 585 | {file = "lazy_object_proxy-1.9.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f699ac1c768270c9e384e4cbd268d6e67aebcfae6cd623b4d7c3bfde5a35db59"}, 586 | {file = "lazy_object_proxy-1.9.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:bfb38f9ffb53b942f2b5954e0f610f1e721ccebe9cce9025a38c8ccf4a5183a4"}, 587 | {file = "lazy_object_proxy-1.9.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:189bbd5d41ae7a498397287c408617fe5c48633e7755287b21d741f7db2706a9"}, 588 | {file = "lazy_object_proxy-1.9.0-cp311-cp311-win32.whl", hash = "sha256:81fc4d08b062b535d95c9ea70dbe8a335c45c04029878e62d744bdced5141586"}, 589 | {file = "lazy_object_proxy-1.9.0-cp311-cp311-win_amd64.whl", hash = "sha256:f2457189d8257dd41ae9b434ba33298aec198e30adf2dcdaaa3a28b9994f6adb"}, 590 | {file = "lazy_object_proxy-1.9.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:d9e25ef10a39e8afe59a5c348a4dbf29b4868ab76269f81ce1674494e2565a6e"}, 591 | {file = "lazy_object_proxy-1.9.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cbf9b082426036e19c6924a9ce90c740a9861e2bdc27a4834fd0a910742ac1e8"}, 592 | {file = "lazy_object_proxy-1.9.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f5fa4a61ce2438267163891961cfd5e32ec97a2c444e5b842d574251ade27d2"}, 593 | {file = "lazy_object_proxy-1.9.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:8fa02eaab317b1e9e03f69aab1f91e120e7899b392c4fc19807a8278a07a97e8"}, 594 | {file = "lazy_object_proxy-1.9.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:e7c21c95cae3c05c14aafffe2865bbd5e377cfc1348c4f7751d9dc9a48ca4bda"}, 595 | {file = "lazy_object_proxy-1.9.0-cp37-cp37m-win32.whl", hash = "sha256:f12ad7126ae0c98d601a7ee504c1122bcef553d1d5e0c3bfa77b16b3968d2734"}, 596 | {file = "lazy_object_proxy-1.9.0-cp37-cp37m-win_amd64.whl", hash = "sha256:edd20c5a55acb67c7ed471fa2b5fb66cb17f61430b7a6b9c3b4a1e40293b1671"}, 597 | {file = "lazy_object_proxy-1.9.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2d0daa332786cf3bb49e10dc6a17a52f6a8f9601b4cf5c295a4f85854d61de63"}, 598 | {file = "lazy_object_proxy-1.9.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cd077f3d04a58e83d04b20e334f678c2b0ff9879b9375ed107d5d07ff160171"}, 599 | {file = "lazy_object_proxy-1.9.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:660c94ea760b3ce47d1855a30984c78327500493d396eac4dfd8bd82041b22be"}, 600 | {file = "lazy_object_proxy-1.9.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:212774e4dfa851e74d393a2370871e174d7ff0ebc980907723bb67d25c8a7c30"}, 601 | {file = "lazy_object_proxy-1.9.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:f0117049dd1d5635bbff65444496c90e0baa48ea405125c088e93d9cf4525b11"}, 602 | {file = "lazy_object_proxy-1.9.0-cp38-cp38-win32.whl", hash = "sha256:0a891e4e41b54fd5b8313b96399f8b0e173bbbfc03c7631f01efbe29bb0bcf82"}, 603 | {file = "lazy_object_proxy-1.9.0-cp38-cp38-win_amd64.whl", hash = "sha256:9990d8e71b9f6488e91ad25f322898c136b008d87bf852ff65391b004da5e17b"}, 604 | {file = "lazy_object_proxy-1.9.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9e7551208b2aded9c1447453ee366f1c4070602b3d932ace044715d89666899b"}, 605 | {file = "lazy_object_proxy-1.9.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5f83ac4d83ef0ab017683d715ed356e30dd48a93746309c8f3517e1287523ef4"}, 606 | {file = "lazy_object_proxy-1.9.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7322c3d6f1766d4ef1e51a465f47955f1e8123caee67dd641e67d539a534d006"}, 607 | {file = "lazy_object_proxy-1.9.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:18b78ec83edbbeb69efdc0e9c1cb41a3b1b1ed11ddd8ded602464c3fc6020494"}, 608 | {file = "lazy_object_proxy-1.9.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:09763491ce220c0299688940f8dc2c5d05fd1f45af1e42e636b2e8b2303e4382"}, 609 | {file = "lazy_object_proxy-1.9.0-cp39-cp39-win32.whl", hash = "sha256:9090d8e53235aa280fc9239a86ae3ea8ac58eff66a705fa6aa2ec4968b95c821"}, 610 | {file = "lazy_object_proxy-1.9.0-cp39-cp39-win_amd64.whl", hash = "sha256:db1c1722726f47e10e0b5fdbf15ac3b8adb58c091d12b3ab713965795036985f"}, 611 | ] 612 | mccabe = [ 613 | {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, 614 | {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, 615 | ] 616 | mypy = [ 617 | {file = "mypy-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e0626db16705ab9f7fa6c249c017c887baf20738ce7f9129da162bb3075fc1af"}, 618 | {file = "mypy-1.0.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1ace23f6bb4aec4604b86c4843276e8fa548d667dbbd0cb83a3ae14b18b2db6c"}, 619 | {file = "mypy-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87edfaf344c9401942883fad030909116aa77b0fa7e6e8e1c5407e14549afe9a"}, 620 | {file = "mypy-1.0.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0ab090d9240d6b4e99e1fa998c2d0aa5b29fc0fb06bd30e7ad6183c95fa07593"}, 621 | {file = "mypy-1.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:7cc2c01dfc5a3cbddfa6c13f530ef3b95292f926329929001d45e124342cd6b7"}, 622 | {file = "mypy-1.0.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:14d776869a3e6c89c17eb943100f7868f677703c8a4e00b3803918f86aafbc52"}, 623 | {file = "mypy-1.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bb2782a036d9eb6b5a6efcdda0986774bf798beef86a62da86cb73e2a10b423d"}, 624 | {file = "mypy-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5cfca124f0ac6707747544c127880893ad72a656e136adc935c8600740b21ff5"}, 625 | {file = "mypy-1.0.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:8845125d0b7c57838a10fd8925b0f5f709d0e08568ce587cc862aacce453e3dd"}, 626 | {file = "mypy-1.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:01b1b9e1ed40544ef486fa8ac022232ccc57109f379611633ede8e71630d07d2"}, 627 | {file = "mypy-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c7cf862aef988b5fbaa17764ad1d21b4831436701c7d2b653156a9497d92c83c"}, 628 | {file = "mypy-1.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5cd187d92b6939617f1168a4fe68f68add749902c010e66fe574c165c742ed88"}, 629 | {file = "mypy-1.0.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:4e5175026618c178dfba6188228b845b64131034ab3ba52acaffa8f6c361f805"}, 630 | {file = "mypy-1.0.0-cp37-cp37m-win_amd64.whl", hash = "sha256:2f6ac8c87e046dc18c7d1d7f6653a66787a4555085b056fe2d599f1f1a2a2d21"}, 631 | {file = "mypy-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7306edca1c6f1b5fa0bc9aa645e6ac8393014fa82d0fa180d0ebc990ebe15964"}, 632 | {file = "mypy-1.0.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:3cfad08f16a9c6611e6143485a93de0e1e13f48cfb90bcad7d5fde1c0cec3d36"}, 633 | {file = "mypy-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67cced7f15654710386e5c10b96608f1ee3d5c94ca1da5a2aad5889793a824c1"}, 634 | {file = "mypy-1.0.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:a86b794e8a56ada65c573183756eac8ac5b8d3d59daf9d5ebd72ecdbb7867a43"}, 635 | {file = "mypy-1.0.0-cp38-cp38-win_amd64.whl", hash = "sha256:50979d5efff8d4135d9db293c6cb2c42260e70fb010cbc697b1311a4d7a39ddb"}, 636 | {file = "mypy-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3ae4c7a99e5153496243146a3baf33b9beff714464ca386b5f62daad601d87af"}, 637 | {file = "mypy-1.0.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5e398652d005a198a7f3c132426b33c6b85d98aa7dc852137a2a3be8890c4072"}, 638 | {file = "mypy-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:be78077064d016bc1b639c2cbcc5be945b47b4261a4f4b7d8923f6c69c5c9457"}, 639 | {file = "mypy-1.0.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:92024447a339400ea00ac228369cd242e988dd775640755fa4ac0c126e49bb74"}, 640 | {file = "mypy-1.0.0-cp39-cp39-win_amd64.whl", hash = "sha256:fe523fcbd52c05040c7bee370d66fee8373c5972171e4fbc323153433198592d"}, 641 | {file = "mypy-1.0.0-py3-none-any.whl", hash = "sha256:2efa963bdddb27cb4a0d42545cd137a8d2b883bd181bbc4525b568ef6eca258f"}, 642 | {file = "mypy-1.0.0.tar.gz", hash = "sha256:f34495079c8d9da05b183f9f7daec2878280c2ad7cc81da686ef0b484cea2ecf"}, 643 | ] 644 | mypy-extensions = [ 645 | {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, 646 | {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, 647 | ] 648 | nox = [] 649 | nox-poetry = [] 650 | packaging = [ 651 | {file = "packaging-23.0-py3-none-any.whl", hash = "sha256:714ac14496c3e68c99c29b00845f7a2b85f3bb6f1078fd9f72fd20f0570002b2"}, 652 | {file = "packaging-23.0.tar.gz", hash = "sha256:b6ad297f8907de0fa2fe1ccbd26fdaf387f5f47c7275fedf8cce89f99446cf97"}, 653 | ] 654 | pathspec = [ 655 | {file = "pathspec-0.11.0-py3-none-any.whl", hash = "sha256:3a66eb970cbac598f9e5ccb5b2cf58930cd8e3ed86d393d541eaf2d8b1705229"}, 656 | {file = "pathspec-0.11.0.tar.gz", hash = "sha256:64d338d4e0914e91c1792321e6907b5a593f1ab1851de7fc269557a21b30ebbc"}, 657 | ] 658 | platformdirs = [ 659 | {file = "platformdirs-2.6.2-py3-none-any.whl", hash = "sha256:83c8f6d04389165de7c9b6f0c682439697887bca0aa2f1c87ef1826be3584490"}, 660 | {file = "platformdirs-2.6.2.tar.gz", hash = "sha256:e1fea1fe471b9ff8332e229df3cb7de4f53eeea4998d3b6bfff542115e998bd2"}, 661 | ] 662 | pluggy = [ 663 | {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, 664 | {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, 665 | ] 666 | py = [ 667 | {file = "py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"}, 668 | {file = "py-1.11.0.tar.gz", hash = "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"}, 669 | ] 670 | pycodestyle = [ 671 | {file = "pycodestyle-2.8.0-py2.py3-none-any.whl", hash = "sha256:720f8b39dde8b293825e7ff02c475f3077124006db4f440dcbc9a20b76548a20"}, 672 | {file = "pycodestyle-2.8.0.tar.gz", hash = "sha256:eddd5847ef438ea1c7870ca7eb78a9d47ce0cdb4851a5523949f2601d0cbbe7f"}, 673 | ] 674 | pyflakes = [ 675 | {file = "pyflakes-2.4.0-py2.py3-none-any.whl", hash = "sha256:3bb3a3f256f4b7968c9c788781e4ff07dce46bdf12339dcda61053375426ee2e"}, 676 | {file = "pyflakes-2.4.0.tar.gz", hash = "sha256:05a85c2872edf37a4ed30b0cce2f6093e1d0581f8c19d7393122da7e25b2b24c"}, 677 | ] 678 | pytest = [ 679 | {file = "pytest-7.2.1-py3-none-any.whl", hash = "sha256:c7c6ca206e93355074ae32f7403e8ea12163b1163c976fee7d4d84027c162be5"}, 680 | {file = "pytest-7.2.1.tar.gz", hash = "sha256:d45e0952f3727241918b8fd0f376f5ff6b301cc0777c6f9a556935c92d8a7d42"}, 681 | ] 682 | pytest-cov = [ 683 | {file = "pytest-cov-4.0.0.tar.gz", hash = "sha256:996b79efde6433cdbd0088872dbc5fb3ed7fe1578b68cdbba634f14bb8dd0470"}, 684 | {file = "pytest_cov-4.0.0-py3-none-any.whl", hash = "sha256:2feb1b751d66a8bd934e5edfa2e961d11309dc37b73b0eabe73b5945fee20f6b"}, 685 | ] 686 | tomli = [] 687 | tomlkit = [ 688 | {file = "tomlkit-0.11.6-py3-none-any.whl", hash = "sha256:07de26b0d8cfc18f871aec595fda24d95b08fef89d147caa861939f37230bf4b"}, 689 | {file = "tomlkit-0.11.6.tar.gz", hash = "sha256:71b952e5721688937fb02cf9d354dbcf0785066149d2855e44531ebdd2b65d73"}, 690 | ] 691 | typed-ast = [] 692 | typing-extensions = [ 693 | {file = "typing_extensions-4.4.0-py3-none-any.whl", hash = "sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e"}, 694 | {file = "typing_extensions-4.4.0.tar.gz", hash = "sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa"}, 695 | ] 696 | virtualenv = [ 697 | {file = "virtualenv-20.16.2-py2.py3-none-any.whl", hash = "sha256:635b272a8e2f77cb051946f46c60a54ace3cb5e25568228bd6b57fc70eca9ff3"}, 698 | {file = "virtualenv-20.16.2.tar.gz", hash = "sha256:0ef5be6d07181946891f5abc8047fda8bc2f0b4b9bf222c64e6e8963baee76db"}, 699 | ] 700 | wrapt = [] 701 | zipp = [ 702 | {file = "zipp-3.13.0-py3-none-any.whl", hash = "sha256:e8b2a36ea17df80ffe9e2c4fda3f693c3dad6df1697d3cd3af232db680950b0b"}, 703 | {file = "zipp-3.13.0.tar.gz", hash = "sha256:23f70e964bc11a34cef175bc90ba2914e1e4545ea1e3e2f67c079671883f9cb6"}, 704 | ] 705 | -------------------------------------------------------------------------------- /py_ts_interfaces/__init__.py: -------------------------------------------------------------------------------- 1 | import collections 2 | 3 | from .parser import Interface as Interface 4 | from .parser import Parser as Parser 5 | -------------------------------------------------------------------------------- /py_ts_interfaces/cli.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import os 3 | import warnings 4 | from collections import deque 5 | from typing import Iterable, List, Set 6 | 7 | from py_ts_interfaces import Interface, Parser 8 | 9 | 10 | def main() -> None: 11 | args = get_args_namespace() 12 | if os.path.isdir(args.outpath): 13 | raise Exception(f"{args.outpath} is a directory! Aborting.") 14 | 15 | interface_parser = Parser(f"{Interface.__module__}.{Interface.__name__}") 16 | 17 | for code in read_code_from_files(get_paths_to_py_files(args.paths)): 18 | interface_parser.parse(code) 19 | 20 | result = interface_parser.flush() 21 | if not result: 22 | warnings.warn("Did not have anything to write to the file!", UserWarning) 23 | 24 | if not args.should_append or not os.path.isfile(args.outpath): 25 | with open(args.outpath, "w") as f: 26 | f.write( 27 | "// Generated using py-ts-interfaces.\n" 28 | "// See https://github.com/cs-cordero/py-ts-interfaces\n\n" 29 | ) 30 | f.write(result) 31 | print(f"Created {args.outpath}!") 32 | else: 33 | with open(args.outpath, "a") as f: 34 | f.write(result) 35 | print(f"Appended to {args.outpath}!") 36 | 37 | 38 | def get_args_namespace() -> argparse.Namespace: 39 | argparser = argparse.ArgumentParser( 40 | description="Generates TypeScript Interfaces from subclasses of" 41 | " py_ts_interfaces.Interface." 42 | ) 43 | argparser.add_argument("paths", action="store", nargs="+") 44 | argparser.add_argument( 45 | "-o, --outpath", action="store", default="interface.ts", dest="outpath" 46 | ) 47 | argparser.add_argument("-a, --append", action="store_true", dest="should_append") 48 | return argparser.parse_args() 49 | 50 | 51 | def get_paths_to_py_files(raw_paths: List[str]) -> Set[str]: 52 | paths: Set[str] = set() 53 | queue = deque(raw_paths) 54 | while queue: 55 | path = queue.popleft() 56 | if os.path.isfile(path): 57 | if path.endswith(".py"): 58 | paths.add(path) 59 | continue 60 | 61 | if os.path.isdir(path): 62 | queue.extend( 63 | [os.path.join(path, next_path) for next_path in os.listdir(path)] 64 | ) 65 | continue 66 | 67 | warnings.warn(f"Skipping {path}!", UserWarning) 68 | return paths 69 | 70 | 71 | def read_code_from_files(paths: Iterable[str]) -> Iterable[str]: 72 | for path in paths: 73 | with open(path, "r") as f: 74 | yield f.read() 75 | 76 | 77 | if __name__ == "__main__": 78 | main() 79 | -------------------------------------------------------------------------------- /py_ts_interfaces/parser.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | from collections import deque 3 | from typing import Dict, List, NamedTuple, Optional, Union 4 | 5 | import astroid 6 | 7 | 8 | class Interface: 9 | pass 10 | 11 | 12 | class PossibleInterfaceReference(str): 13 | pass 14 | 15 | 16 | TYPE_MAP: Dict[str, str] = { 17 | "bool": "boolean", 18 | "str": "string", 19 | "int": "number", 20 | "float": "number", 21 | "complex": "number", 22 | "Any": "any", 23 | "Dict": "Record", 24 | "List": "Array", 25 | "Tuple": "[any]", 26 | "Union": "any", 27 | } 28 | 29 | SUBSCRIPT_FORMAT_MAP: Dict[str, str] = { 30 | "Dict": "Record<%s>", 31 | "List": "Array<%s>", 32 | "Optional": "%s | null", 33 | "Tuple": "[%s]", 34 | "Union": "%s", 35 | } 36 | 37 | 38 | InterfaceAttributes = Dict[str, str] 39 | PreparedInterfaces = Dict[str, InterfaceAttributes] 40 | 41 | 42 | class Parser: 43 | def __init__(self, interface_qualname: str) -> None: 44 | self.interface_qualname = interface_qualname 45 | self.prepared: PreparedInterfaces = {} 46 | 47 | def parse(self, code: str) -> None: 48 | queue = deque([astroid.parse(code)]) 49 | while queue: 50 | current = queue.popleft() 51 | children = current.get_children() 52 | if not isinstance(current, astroid.ClassDef): 53 | queue.extend(children) 54 | continue 55 | 56 | if not current.is_subtype_of(self.interface_qualname): 57 | queue.extend(children) 58 | continue 59 | 60 | if not has_dataclass_decorator(current.decorators): 61 | warnings.warn( 62 | "Non-dataclasses are not supported, see documentation.", UserWarning 63 | ) 64 | continue 65 | 66 | if current.name in self.prepared: 67 | warnings.warn( 68 | f"Found duplicate interface with name {current.name}." 69 | "All interfaces after the first will be ignored", 70 | UserWarning, 71 | ) 72 | continue 73 | 74 | self.prepared[current.name] = get_types_from_classdef(current) 75 | ensure_possible_interface_references_valid(self.prepared) 76 | 77 | def flush(self) -> str: 78 | serialized: List[str] = [] 79 | 80 | for interface, attributes in self.prepared.items(): 81 | s = f"interface {interface} {{\n" 82 | for attribute_name, attribute_type in attributes.items(): 83 | s += f" {attribute_name}: {attribute_type};\n" 84 | s += "}" 85 | serialized.append(s) 86 | 87 | self.prepared.clear() 88 | return "\n\n".join(serialized).strip() + "\n" 89 | 90 | 91 | def get_types_from_classdef(node: astroid.ClassDef) -> Dict[str, str]: 92 | serialized_types: Dict[str, str] = {} 93 | for child in node.body: 94 | if not isinstance(child, astroid.AnnAssign): 95 | continue 96 | child_name, child_type = parse_annassign_node(child) 97 | serialized_types[child_name] = child_type 98 | return serialized_types 99 | 100 | 101 | class ParsedAnnAssign(NamedTuple): 102 | attr_name: str 103 | attr_type: str 104 | 105 | 106 | def parse_annassign_node(node: astroid.AnnAssign) -> ParsedAnnAssign: 107 | def helper( 108 | node: astroid.node_classes.NodeNG, 109 | ) -> Union[str, PossibleInterfaceReference]: 110 | type_value = "UNKNOWN" 111 | 112 | if isinstance(node, astroid.Name): 113 | # When the node is of an astroid.Name type, it could have a 114 | # name that exists in our TYPE_MAP, it could have a name that 115 | # refers to another class previously defined in the source, or 116 | # it could be a forward reference to a class that has yet to 117 | # be parsed. 118 | # We will have to assume it is a valid forward reference now and 119 | # then just double check that it does indeed reference another 120 | # Interface class as a post-parse step. 121 | type_value = TYPE_MAP.get(node.name, PossibleInterfaceReference(node.name)) 122 | if node.name == "Union": 123 | warnings.warn( 124 | "Came across an annotation for Union without any indexed types!" 125 | " Coercing the annotation to any.", 126 | UserWarning, 127 | ) 128 | 129 | elif isinstance(node, astroid.Const) and node.name == "str": 130 | # When the node is of an astroid.Const type, it could be one of 131 | # num, str, bool, None, or bytes. 132 | # If it is Const.str, then it is possible that the value is a 133 | # reference to a class previously defined in the source or it could 134 | # be a forward reference to a class that has yet to be parsed. 135 | type_value = PossibleInterfaceReference(node.value) 136 | 137 | elif isinstance(node, astroid.Subscript): 138 | subscript_value = node.value 139 | type_format = SUBSCRIPT_FORMAT_MAP[subscript_value.name] 140 | type_value = type_format % helper(node.slice) 141 | 142 | elif isinstance(node, astroid.Tuple): 143 | inner_types = get_inner_tuple_types(node) 144 | delimiter = get_inner_tuple_delimiter(node) 145 | 146 | if delimiter == " | ": 147 | inner_types_deduplicated = [] 148 | 149 | # Deduplicate inner types using a list to preserve order 150 | for inner_type in inner_types: 151 | if inner_type not in inner_types_deduplicated: 152 | inner_types_deduplicated.append(inner_type) 153 | 154 | inner_types = inner_types_deduplicated 155 | 156 | if delimiter != "UNKNOWN": 157 | type_value = delimiter.join(inner_types) 158 | 159 | return type_value 160 | 161 | def get_inner_tuple_types(tuple_node: astroid.Tuple) -> List[str]: 162 | # avoid using Set to keep order. We also want repetitions 163 | # to avoid problems with tuples where repeated types do have 164 | # a meaning (e.g., Dict[int, int]). 165 | inner_types: List[str] = [] 166 | for child in tuple_node.get_children(): 167 | inner_types.append(helper(child)) 168 | 169 | return inner_types 170 | 171 | def get_inner_tuple_delimiter(tuple_node: astroid.Tuple) -> str: 172 | parent_subscript_name = tuple_node.parent.value.name 173 | delimiter = "UNKNOWN" 174 | if parent_subscript_name in {"Dict", "Tuple"}: 175 | delimiter = ", " 176 | elif parent_subscript_name == "Union": 177 | delimiter = " | " 178 | return delimiter 179 | 180 | return ParsedAnnAssign(node.target.name, helper(node.annotation)) 181 | 182 | 183 | def has_dataclass_decorator(decorators: Optional[astroid.Decorators]) -> bool: 184 | if not decorators: 185 | return False 186 | 187 | return any( 188 | (getattr(decorator.func, "name", None) == "dataclass") 189 | if isinstance(decorator, astroid.Call) 190 | else decorator.name == "dataclass" 191 | for decorator in decorators.nodes 192 | ) 193 | 194 | 195 | def ensure_possible_interface_references_valid(interfaces: PreparedInterfaces) -> None: 196 | interface_names = set(interfaces.keys()) 197 | 198 | for interface, attributes in interfaces.items(): 199 | for attribute_name, attribute_type in attributes.items(): 200 | if not isinstance(attribute_type, PossibleInterfaceReference): 201 | continue 202 | 203 | if attribute_type not in interface_names: 204 | raise RuntimeError( 205 | f"Invalid nested Interface reference '{attribute_type}'" 206 | f" found for interface {interface}!\n" 207 | f"Does '{attribute_type}' exist and is it an Interface?" 208 | ) 209 | -------------------------------------------------------------------------------- /py_ts_interfaces/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs-cordero/py-ts-interfaces/e06dbc812c045c702892a68d76a037f6e3dee4b1/py_ts_interfaces/py.typed -------------------------------------------------------------------------------- /py_ts_interfaces/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs-cordero/py-ts-interfaces/e06dbc812c045c702892a68d76a037f6e3dee4b1/py_ts_interfaces/tests/__init__.py -------------------------------------------------------------------------------- /py_ts_interfaces/tests/tests.py: -------------------------------------------------------------------------------- 1 | from copy import deepcopy 2 | from itertools import count 3 | from typing import Any 4 | from unittest.mock import patch 5 | 6 | import pytest 7 | from astroid import AnnAssign, ClassDef, extract_node 8 | 9 | from py_ts_interfaces import Interface, Parser 10 | from py_ts_interfaces.parser import ( 11 | PossibleInterfaceReference, 12 | PreparedInterfaces, 13 | ensure_possible_interface_references_valid, 14 | get_types_from_classdef, 15 | parse_annassign_node, 16 | ) 17 | from py_ts_interfaces.tests import utils 18 | 19 | 20 | @pytest.fixture(scope="module") 21 | def interface_qualname() -> str: 22 | return f"{Interface.__module__}.{Interface.__qualname__}" 23 | 24 | 25 | PYTHON_VERSION = utils.get_version() 26 | 27 | 28 | TEST_ONE = """ 29 | class Foo: 30 | pass 31 | """ 32 | TEST_TWO = """ 33 | from py_ts_interfaces import Interface 34 | 35 | class Foo(Interface): 36 | pass 37 | """ 38 | TEST_THREE = """ 39 | from dataclasses import dataclass 40 | from py_ts_interfaces import Interface 41 | 42 | @dataclass 43 | class Foo(Interface): 44 | pass 45 | """ 46 | TEST_FOUR = """ 47 | from dataclasses import dataclass 48 | from py_ts_interfaces import Interface 49 | 50 | @dataclass 51 | class Foo(Interface): 52 | pass 53 | 54 | @dataclass 55 | class Bar(Interface): 56 | pass 57 | 58 | class Baz(Interface): 59 | pass 60 | 61 | class Parent: 62 | class Child1(Interface): 63 | pass 64 | 65 | @dataclass 66 | class Child2(Interface): 67 | pass 68 | """ 69 | TEST_FIVE = """ 70 | from dataclasses import dataclass 71 | 72 | class Interface: 73 | pass 74 | 75 | class Foo(Interface): 76 | pass 77 | 78 | @dataclass 79 | class Bar(Interface): 80 | pass 81 | """ 82 | 83 | TEST_SIX = """ 84 | from dataclasses import dataclass 85 | from py_ts_interfaces import Interface 86 | 87 | @dataclass 88 | class Foo(Interface): #@ 89 | aaa: str 90 | bbb: int 91 | ccc: bool 92 | ddd = 100 93 | 94 | def foo(self) -> None: 95 | pass 96 | """ 97 | TEST_SEVEN = """ 98 | from dataclasses import dataclass 99 | from py_ts_interfaces import Interface 100 | 101 | @dataclass 102 | class Foo(Interface): #@ 103 | def foo(self) -> None: 104 | pass 105 | 106 | aaa: str = 'hello' 107 | bbb: int = 5 108 | ccc: bool = True 109 | """ 110 | 111 | TEST_EIGHT = """ 112 | from dataclasses import dataclass 113 | from py_ts_interfaces import Interface 114 | 115 | @dataclass 116 | class Foo(Interface): 117 | aaa: str 118 | 119 | @dataclass 120 | class Foo(Interface): 121 | bbb: int 122 | """ 123 | 124 | TEST_NINE = """ 125 | from dataclasses import dataclass 126 | from py_ts_interfaces import Interface 127 | 128 | @dataclass 129 | class Foo(Interface): 130 | aaa: str 131 | 132 | @dataclass 133 | class Bar(Interface): 134 | bbb: int 135 | foo: Foo 136 | """ 137 | 138 | TEST_TEN = """ 139 | from dataclasses import dataclass 140 | from py_ts_interfaces import Interface 141 | 142 | @dataclass 143 | class One(Interface): 144 | aaa: str 145 | 146 | @dataclass 147 | class Two(Interface): 148 | bbb: int 149 | one: One 150 | 151 | @dataclass 152 | class Three(Interface): 153 | bbb: int 154 | two: Two 155 | 156 | @dataclass 157 | class All(Interface): 158 | bbb: int 159 | one: One 160 | two: Two 161 | three: Three 162 | """ 163 | 164 | 165 | @pytest.mark.filterwarnings("ignore::UserWarning") 166 | @pytest.mark.parametrize( 167 | "code, expected_call_count", 168 | [ 169 | (TEST_ONE, 0), 170 | (TEST_TWO, 0), 171 | (TEST_THREE, 1), 172 | (TEST_FOUR, 3), 173 | (TEST_FIVE, 0), 174 | (TEST_EIGHT, 1), 175 | (TEST_NINE, 2), 176 | (TEST_TEN, 4), 177 | ], 178 | ) 179 | def test_parser_parse( 180 | code: str, expected_call_count: int, interface_qualname: str 181 | ) -> None: 182 | parser = Parser(interface_qualname) 183 | with patch("py_ts_interfaces.parser.get_types_from_classdef") as mock_writer: 184 | parser.parse(code=code) 185 | assert mock_writer.call_count == expected_call_count 186 | 187 | 188 | @pytest.mark.parametrize( 189 | "prepared_mocks, expected", 190 | [ 191 | ({"abc": {"def": "ghi"}}, """interface abc {\n def: ghi;\n}\n"""), 192 | ( 193 | {"abc": {"def": "ghi", "jkl": "mno"}}, 194 | """interface abc {\n def: ghi;\n jkl: mno;\n}\n""", 195 | ), 196 | ({"abc": {}}, """interface abc {\n}\n"""), 197 | ( 198 | {"abc": {"def": PossibleInterfaceReference("ghi")}, "ghi": {"jkl": "mno"}}, 199 | """interface abc {\n def: ghi;\n}\n\n""" 200 | """interface ghi {\n jkl: mno;\n}\n""", 201 | ), 202 | ], 203 | ) 204 | def test_parser_flush( 205 | prepared_mocks: Any, expected: str, interface_qualname: str 206 | ) -> None: 207 | """ 208 | When the parser flushes its prepared interfaces, it should generate 209 | valid TS interfaces. 210 | """ 211 | parser = Parser(interface_qualname) 212 | parser.prepared = prepared_mocks 213 | assert parser.flush() == expected 214 | 215 | 216 | @pytest.mark.filterwarnings("ignore::UserWarning") 217 | @pytest.mark.parametrize( 218 | "code, expected", 219 | [ 220 | ("baz: str", ("baz", "string")), 221 | ("ace: int", ("ace", "number")), 222 | ("ace: float", ("ace", "number")), 223 | ("ace: complex", ("ace", "number")), 224 | ("ace: bool", ("ace", "boolean")), 225 | ("ace: Any", ("ace", "any")), 226 | ("foo: List", ("foo", "Array")), 227 | ("foo: Dict", ("foo", "Record")), 228 | ("bar: Tuple", ("bar", "[any]")), 229 | ("foo: List[str]", ("foo", "Array")), 230 | ("bar: Tuple[str, int]", ("bar", "[string, number]")), 231 | ("baz: Optional[str]", ("baz", "string | null")), 232 | ("ace: Optional[int]", ("ace", "number | null")), 233 | ("ace: Optional[float]", ("ace", "number | null")), 234 | ("ace: Optional[complex]", ("ace", "number | null")), 235 | ("ace: Optional[bool]", ("ace", "boolean | null")), 236 | ("ace: Optional[Any]", ("ace", "any | null")), 237 | ("foo: Dict[str, int]", ("foo", "Record")), 238 | ("foo: Dict[int, int]", ("foo", "Record")), 239 | ( 240 | "bar: Optional[Tuple[str, int]]", 241 | ("bar", "[string, number] | null"), 242 | ), 243 | ( 244 | "bar: Tuple[List[Optional[Tuple[str, int]]], str, int]", 245 | ("bar", "[Array<[string, number] | null>, string, number]"), 246 | ), 247 | ("lol: Union[str, int, float]", ("lol", "string | number")), 248 | ("lol: Union", ("lol", "any")), 249 | ( 250 | "whatever: 'StringForward'", 251 | ("whatever", PossibleInterfaceReference("StringForward")), 252 | ), 253 | ( 254 | "whatever: NakedReference", 255 | ("whatever", PossibleInterfaceReference("NakedReference")), 256 | ), 257 | ("whatever: 1234", ("whatever", "UNKNOWN")), 258 | ], 259 | ) 260 | def test_parse_annassign_node(code: str, expected: Any) -> None: 261 | ann_assign = extract_node(code) 262 | assert isinstance(ann_assign, AnnAssign) 263 | assert parse_annassign_node(ann_assign) == expected 264 | 265 | 266 | @pytest.mark.parametrize("code, expected_call_count", [(TEST_SIX, 0), (TEST_SEVEN, 0)]) 267 | def test_get_types_from_classdef(code: str, expected_call_count: int) -> None: 268 | class_def = extract_node(code) 269 | assert isinstance(class_def, ClassDef) 270 | with patch("py_ts_interfaces.parser.parse_annassign_node") as annassign_parser: 271 | k, v = count(0, 2), count(1, 2) 272 | annassign_parser.side_effect = lambda x: (str(next(k)), str(next(v))) 273 | 274 | result = get_types_from_classdef(class_def) 275 | assert result == {"0": "1", "2": "3", "4": "5"} 276 | assert annassign_parser.call_count == 3 277 | 278 | 279 | @pytest.mark.parametrize( 280 | "interfaces", 281 | [ 282 | {"interfaceA": {"name": "str"}, "interfaceB": {"another_name": "int"}}, 283 | { 284 | "interfaceA": {"name": PossibleInterfaceReference("interfaceB")}, 285 | "interfaceB": {"another_name": "int"}, 286 | }, 287 | {"interfaceA": {"name": PossibleInterfaceReference("interfaceA")}}, 288 | ], 289 | ) 290 | def test_ensure_possible_interface_references_valid__succeeds( 291 | interfaces: PreparedInterfaces, 292 | ) -> None: 293 | copied_interfaces = deepcopy(interfaces) 294 | ensure_possible_interface_references_valid(interfaces) 295 | assert copied_interfaces == interfaces # Make sure no mutations occurred 296 | 297 | 298 | @pytest.mark.parametrize( 299 | "interfaces", 300 | [ 301 | { 302 | "interfaceA": {"name": PossibleInterfaceReference("interfaceB")}, 303 | "interfaceB": {"another_name": PossibleInterfaceReference("interfaceC")}, 304 | }, 305 | {"interfaceA": {"name": PossibleInterfaceReference("interfaceB")}}, 306 | ], 307 | ) 308 | def test_ensure_possible_interface_references_valid__fails( 309 | interfaces: PreparedInterfaces, 310 | ) -> None: 311 | with pytest.raises(RuntimeError): 312 | ensure_possible_interface_references_valid(interfaces) 313 | -------------------------------------------------------------------------------- /py_ts_interfaces/tests/utils.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | 4 | def get_version() -> float: 5 | if sys.version_info.major < 3 or sys.version_info.minor < 7: 6 | raise Exception("py-ts-interfaces only supports Python 3.7 or above.") 7 | 8 | return float(sys.version_info.major) + (sys.version_info.minor / 10) 9 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = 'py-ts-interfaces' 3 | version = '0.5.0' 4 | description = 'A library that converts Python dataclasses with type annotations to a TypeScript interface and serializes them to a file.' 5 | license = 'MIT' 6 | authors = [ 7 | 'Christopher Cordero ' 8 | ] 9 | readme = 'README.md' 10 | repository = 'https://github.com/cs-cordero/py-ts-interfaces' 11 | homepage = 'https://github.com/cs-cordero/py-ts-interfaces' 12 | documentation = 'https://github.com/cs-cordero/py-ts-interfaces' 13 | keywords = ['python', 'typescript', 'interfaces'] 14 | classifiers = [ 15 | "License :: OSI Approved :: MIT License", 16 | "Operating System :: OS Independent", 17 | "Programming Language :: Python", 18 | "Programming Language :: Python :: 3 :: Only", 19 | "Programming Language :: Python :: 3.7", 20 | "Programming Language :: Python :: 3.8", 21 | "Programming Language :: Python :: 3.9", 22 | "Programming Language :: Python :: 3.10", 23 | "Typing :: Typed" 24 | ] 25 | 26 | [build-system] 27 | requires = ["poetry_core>=1.0.0"] 28 | build-backend = "poetry.core.masonry.api" 29 | 30 | [tool.poetry.dependencies] 31 | python = '^3.7.2' 32 | astroid = "2.14.2" 33 | 34 | [tool.poetry.dev-dependencies] 35 | black = '22.6.0' 36 | flake8 = '4.0.1' 37 | mypy = '1.0.0' 38 | pytest-cov = '4.0.0' 39 | pytest = "7.2.1" 40 | isort = [ 41 | { version = "5.11.5", python = "<3.8" }, 42 | { version = "5.12.0", python = ">=3.8" } 43 | ] 44 | nox = "2022.1.7" 45 | nox-poetry = "1.0.1" 46 | typed-ast = { version = "1.5.4", python = "<3.8" } 47 | 48 | [tool.poetry.scripts] 49 | py-ts-interfaces = "py_ts_interfaces.cli:main" 50 | -------------------------------------------------------------------------------- /run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | RED='\033[0;31m' 4 | GREEN='\033[0;32m' 5 | RESET='\033[0m' 6 | 7 | AT_LEAST_ONE_ERROR=0 8 | 9 | function capture_stdout_and_stderr_if_successful { 10 | set +e 11 | COMMAND=$* 12 | printf "Running %s ... " "${COMMAND}" 13 | 14 | if ! OUTPUT=$($COMMAND 2>&1); then 15 | AT_LEAST_ONE_ERROR=1 16 | printf "%bFailed%b\n" "${RED}" "${RESET}" 17 | printf "%s\n\n" "${OUTPUT}" 18 | else 19 | printf "%bSuccess!%b\n" "${GREEN}" "${RESET}" 20 | fi 21 | set -e 22 | } 23 | 24 | capture_stdout_and_stderr_if_successful black --check py_ts_interfaces 25 | capture_stdout_and_stderr_if_successful flake8 --count py_ts_interfaces 26 | capture_stdout_and_stderr_if_successful mypy py_ts_interfaces 27 | capture_stdout_and_stderr_if_successful isort -c py_ts_interfaces 28 | capture_stdout_and_stderr_if_successful pytest 29 | 30 | exit $AT_LEAST_ONE_ERROR 31 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [mypy] 2 | python_version = 3.7 3 | mypy_path = stubs 4 | 5 | dump_inference_stats = False 6 | dump_type_stats = False 7 | incremental = False 8 | pdb = False 9 | show_column_numbers = False 10 | show_error_context = True 11 | show_traceback = False 12 | verbosity = 0 13 | 14 | check_untyped_defs = True 15 | debug_cache = False 16 | disallow_any_decorated = False 17 | disallow_any_explicit = False 18 | disallow_any_expr = False 19 | disallow_any_generics = True 20 | disallow_any_unimported = True 21 | disallow_incomplete_defs = True 22 | disallow_subclassing_any = True 23 | disallow_untyped_calls = True 24 | disallow_untyped_defs = True 25 | follow_imports = normal 26 | follow_imports_for_stubs = True 27 | ignore_errors = False 28 | ignore_missing_imports = False 29 | no_implicit_optional = True 30 | show_none_errors = True 31 | strict_optional = True 32 | warn_incomplete_stub = True 33 | warn_no_return = True 34 | warn_redundant_casts = True 35 | warn_return_any = True 36 | warn_unused_ignores = True 37 | 38 | # No incremental mode 39 | cache_dir = /tmp/ 40 | 41 | [mypy-*.tests] 42 | ignore_errors = True 43 | 44 | [mypy-*.pytest] 45 | ignore_errors = True 46 | 47 | [tool:pytest] 48 | addopts = 49 | -p no:cacheprovider 50 | --cov=py_ts_interfaces 51 | --cov-report=term-missing 52 | --cov-config=setup.cfg 53 | --no-cov-on-fail 54 | cache_dir = /tmp/ 55 | console_output_style = progress 56 | python_files = test*.py pytest*.py 57 | testpaths = py_ts_interfaces 58 | xfail_strict = True 59 | 60 | [coverage:run] 61 | omit = 62 | py_ts_interfaces/cli.py 63 | py_ts_interfaces/tests/* 64 | 65 | [coverage:report] 66 | fail_under = 96 67 | 68 | [flake8] 69 | # to comport with black 70 | max-line-length = 88 71 | extend-ignore = E203 72 | per-file-ignores = 73 | **/__init__.py:F401 74 | 75 | [isort] 76 | multi_line_output=3 77 | include_trailing_comma=True 78 | force_grid_wrap=0 79 | use_parentheses=True 80 | line_length=88 81 | -------------------------------------------------------------------------------- /stubs/astroid/__init__.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from astroid.builder import parse as parse 6 | from astroid.builder import extract_node as extract_node 7 | from astroid.exceptions import * 8 | from astroid.nodes import * 9 | from astroid import node_classes as node_classes 10 | from typing import Any 11 | 12 | Load: Any 13 | Store: Any 14 | Del: Any 15 | MANAGER: Any 16 | 17 | def inference_tip(infer_function: Any, raise_on_overwrite: bool = ...) -> Any: ... 18 | def register_module_extender(manager: Any, module_name: Any, get_extension_mod: Any) -> Any: ... 19 | 20 | BRAIN_MODULES_DIR: Any 21 | -------------------------------------------------------------------------------- /stubs/astroid/__pkginfo__.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.__pkginfo__ (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any 6 | 7 | distname: str 8 | modname: str 9 | version: str 10 | numversion: Any 11 | extras_require: Any 12 | install_requires: Any 13 | license: str 14 | author: str 15 | author_email: str 16 | mailinglist: Any 17 | web: str 18 | description: str 19 | classifiers: Any 20 | -------------------------------------------------------------------------------- /stubs/astroid/_ast.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid._ast (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from collections import namedtuple 6 | from typing import Optional 7 | 8 | FunctionType = namedtuple('FunctionType', ['argtypes', 'returns']) 9 | 10 | def parse_function_type_comment(type_comment: str) -> Optional[FunctionType]: ... 11 | -------------------------------------------------------------------------------- /stubs/astroid/arguments.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.arguments (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any, Optional 6 | 7 | class CallSite: 8 | argument_context_map: Any = ... 9 | duplicated_keywords: Any = ... 10 | positional_arguments: Any = ... 11 | keyword_arguments: Any = ... 12 | def __init__(self, callcontext: Any, argument_context_map: Optional[Any] = ...) -> None: ... 13 | @classmethod 14 | def from_call(cls, call_node: Any): ... 15 | def has_invalid_arguments(self): ... 16 | def has_invalid_keywords(self): ... 17 | def infer_argument(self, funcnode: Any, name: Any, context: Any): ... 18 | -------------------------------------------------------------------------------- /stubs/astroid/as_string.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.as_string (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any 6 | 7 | DOC_NEWLINE: str 8 | 9 | class AsStringVisitor: 10 | indent: Any = ... 11 | def __init__(self, indent: Any) -> None: ... 12 | def __call__(self, node: Any): ... 13 | def visit_arguments(self, node: Any): ... 14 | def visit_assignattr(self, node: Any): ... 15 | def visit_assert(self, node: Any): ... 16 | def visit_assignname(self, node: Any): ... 17 | def visit_assign(self, node: Any): ... 18 | def visit_augassign(self, node: Any): ... 19 | def visit_annassign(self, node: Any): ... 20 | def visit_repr(self, node: Any): ... 21 | def visit_binop(self, node: Any): ... 22 | def visit_boolop(self, node: Any): ... 23 | def visit_break(self, node: Any): ... 24 | def visit_call(self, node: Any): ... 25 | def visit_classdef(self, node: Any): ... 26 | def visit_compare(self, node: Any): ... 27 | def visit_comprehension(self, node: Any): ... 28 | def visit_const(self, node: Any): ... 29 | def visit_continue(self, node: Any): ... 30 | def visit_delete(self, node: Any): ... 31 | def visit_delattr(self, node: Any): ... 32 | def visit_delname(self, node: Any): ... 33 | def visit_decorators(self, node: Any): ... 34 | def visit_dict(self, node: Any): ... 35 | def visit_dictunpack(self, node: Any): ... 36 | def visit_dictcomp(self, node: Any): ... 37 | def visit_expr(self, node: Any): ... 38 | def visit_emptynode(self, node: Any): ... 39 | def visit_excepthandler(self, node: Any): ... 40 | def visit_ellipsis(self, node: Any): ... 41 | def visit_empty(self, node: Any): ... 42 | def visit_exec(self, node: Any): ... 43 | def visit_extslice(self, node: Any): ... 44 | def visit_for(self, node: Any): ... 45 | def visit_importfrom(self, node: Any): ... 46 | def visit_functiondef(self, node: Any): ... 47 | def visit_generatorexp(self, node: Any): ... 48 | def visit_attribute(self, node: Any): ... 49 | def visit_global(self, node: Any): ... 50 | def visit_if(self, node: Any): ... 51 | def visit_ifexp(self, node: Any): ... 52 | def visit_import(self, node: Any): ... 53 | def visit_keyword(self, node: Any): ... 54 | def visit_lambda(self, node: Any): ... 55 | def visit_list(self, node: Any): ... 56 | def visit_listcomp(self, node: Any): ... 57 | def visit_module(self, node: Any): ... 58 | def visit_name(self, node: Any): ... 59 | def visit_pass(self, node: Any): ... 60 | def visit_print(self, node: Any): ... 61 | def visit_raise(self, node: Any): ... 62 | def visit_return(self, node: Any): ... 63 | def visit_index(self, node: Any): ... 64 | def visit_set(self, node: Any): ... 65 | def visit_setcomp(self, node: Any): ... 66 | def visit_slice(self, node: Any): ... 67 | def visit_subscript(self, node: Any): ... 68 | def visit_tryexcept(self, node: Any): ... 69 | def visit_tryfinally(self, node: Any): ... 70 | def visit_tuple(self, node: Any): ... 71 | def visit_unaryop(self, node: Any): ... 72 | def visit_while(self, node: Any): ... 73 | def visit_with(self, node: Any): ... 74 | def visit_yield(self, node: Any): ... 75 | def visit_starred(self, node: Any): ... 76 | def visit_frozenset(self, node: Any): ... 77 | def visit_super(self, node: Any): ... 78 | def visit_uninferable(self, node: Any): ... 79 | 80 | class AsStringVisitor3(AsStringVisitor): 81 | def visit_excepthandler(self, node: Any): ... 82 | def visit_nonlocal(self, node: Any): ... 83 | def visit_raise(self, node: Any): ... 84 | def visit_yieldfrom(self, node: Any): ... 85 | def visit_asyncfunctiondef(self, node: Any): ... 86 | def visit_await(self, node: Any): ... 87 | def visit_asyncwith(self, node: Any): ... 88 | def visit_asyncfor(self, node: Any): ... 89 | def visit_joinedstr(self, node: Any): ... 90 | def visit_formattedvalue(self, node: Any): ... 91 | def visit_comprehension(self, node: Any): ... 92 | AsStringVisitor = AsStringVisitor3 93 | to_code: Any 94 | -------------------------------------------------------------------------------- /stubs/astroid/bases.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.bases (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any, Optional 6 | 7 | objectmodel: Any 8 | helpers: Any 9 | BUILTINS: Any 10 | manager: Any 11 | MANAGER: Any 12 | BOOL_SPECIAL_METHOD: str 13 | PROPERTIES: Any 14 | POSSIBLE_PROPERTIES: Any 15 | 16 | class Proxy: 17 | def __init__(self, proxied: Optional[Any] = ...) -> None: ... 18 | def __getattr__(self, name: Any) -> Any: ... 19 | def infer(self, context: Optional[Any] = ...) -> None: ... 20 | 21 | class BaseInstance(Proxy): 22 | special_attributes: Any = ... 23 | def display_type(self) -> Any: ... 24 | def getattr(self, name: Any, context: Optional[Any] = ..., lookupclass: bool = ...) -> Any: ... 25 | def igetattr(self, name: Any, context: Optional[Any] = ...) -> None: ... 26 | def infer_call_result(self, caller: Any, context: Optional[Any] = ...) -> None: ... 27 | 28 | class Instance(BaseInstance): 29 | special_attributes: Any = ... 30 | def callable(self) -> Any: ... 31 | def pytype(self) -> Any: ... 32 | def display_type(self) -> Any: ... 33 | def bool_value(self) -> Any: ... 34 | def getitem(self, index: Any, context: Optional[Any] = ...) -> None: ... 35 | 36 | class UnboundMethod(Proxy): 37 | special_attributes: Any = ... 38 | def implicit_parameters(self) -> Any: ... 39 | def is_bound(self) -> Any: ... 40 | def getattr(self, name: Any, context: Optional[Any] = ...) -> Any: ... 41 | def igetattr(self, name: Any, context: Optional[Any] = ...) -> Any: ... 42 | def infer_call_result(self, caller: Any, context: Any) -> Any: ... 43 | def bool_value(self) -> Any: ... 44 | 45 | class BoundMethod(UnboundMethod): 46 | special_attributes: Any = ... 47 | bound: Any = ... 48 | def __init__(self, proxy: Any, bound: Any) -> None: ... 49 | def implicit_parameters(self) -> Any: ... 50 | def is_bound(self) -> Any: ... 51 | def infer_call_result(self, caller: Any, context: Optional[Any] = ...) -> Any: ... 52 | def bool_value(self) -> Any: ... 53 | 54 | class Generator(BaseInstance): 55 | special_attributes: Any = ... 56 | parent: Any = ... 57 | def __init__(self, parent: Optional[Any] = ...) -> None: ... 58 | def callable(self) -> Any: ... 59 | def pytype(self) -> Any: ... 60 | def display_type(self) -> Any: ... 61 | def bool_value(self) -> Any: ... 62 | 63 | class AsyncGenerator(Generator): 64 | def pytype(self) -> Any: ... 65 | def display_type(self) -> Any: ... 66 | -------------------------------------------------------------------------------- /stubs/astroid/builder.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.builder (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from astroid import raw_building 6 | from typing import Any, Optional 7 | 8 | MANAGER: Any 9 | 10 | def open_source_file(filename: Any) -> Any: ... 11 | 12 | class AstroidBuilder(raw_building.InspectBuilder): 13 | def __init__(self, manager: Optional[Any] = ..., apply_transforms: bool = ...) -> None: ... 14 | def module_build(self, module: Any, modname: Optional[Any] = ...) -> Any: ... 15 | def file_build(self, path: Any, modname: Optional[Any] = ...) -> Any: ... 16 | def string_build(self, data: Any, modname: str = ..., path: Optional[Any] = ...) -> Any: ... 17 | def add_from_names_to_locals(self, node: Any) -> Any: ... 18 | def delayed_assattr(self, node: Any) -> None: ... 19 | 20 | def build_namespace_package_module(name: Any, path: Any) -> Any: ... 21 | def parse(code: Any, module_name: str = ..., path: Optional[Any] = ..., apply_transforms: bool = ...) -> Any: ... 22 | def extract_node(code: Any, module_name: str = ...) -> Any: ... 23 | -------------------------------------------------------------------------------- /stubs/astroid/context.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.context (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any, Optional 6 | 7 | class InferenceContext: 8 | path: Any = ... 9 | lookupname: Any = ... 10 | callcontext: Any = ... 11 | boundnode: Any = ... 12 | inferred: Any = ... 13 | extra_context: Any = ... 14 | def __init__(self, path: Optional[Any] = ..., inferred: Optional[Any] = ...) -> None: ... 15 | def push(self, node: Any): ... 16 | def clone(self): ... 17 | def cache_generator(self, key: Any, generator: Any) -> None: ... 18 | def restore_path(self) -> None: ... 19 | 20 | class CallContext: 21 | args: Any = ... 22 | keywords: Any = ... 23 | def __init__(self, args: Any, keywords: Optional[Any] = ...) -> None: ... 24 | 25 | def copy_context(context: Optional[InferenceContext]) -> InferenceContext: ... 26 | def bind_context_to_node(context: Any, node: Any): ... 27 | -------------------------------------------------------------------------------- /stubs/astroid/decorators.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.decorators (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any, Optional 6 | 7 | def cached(func: Any, instance: Any, args: Any, kwargs: Any): ... 8 | 9 | class cachedproperty: 10 | wrapped: Any = ... 11 | def __init__(self, wrapped: Any) -> None: ... 12 | @property 13 | def __doc__(self): ... 14 | def __get__(self, inst: Any, objtype: Optional[Any] = ...): ... 15 | 16 | def path_wrapper(func: Any): ... 17 | def yes_if_nothing_inferred(func: Any, instance: Any, args: Any, kwargs: Any) -> None: ... 18 | def raise_if_nothing_inferred(func: Any, instance: Any, args: Any, kwargs: Any) -> None: ... 19 | -------------------------------------------------------------------------------- /stubs/astroid/exceptions.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.exceptions (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from astroid import util 6 | from typing import Any 7 | 8 | class AstroidError(Exception): 9 | message: Any = ... 10 | def __init__(self, message: str = ..., **kws: Any) -> None: ... 11 | 12 | class AstroidBuildingError(AstroidError): 13 | def __init__(self, message: str = ..., **kws: Any) -> None: ... 14 | 15 | class AstroidImportError(AstroidBuildingError): ... 16 | 17 | class TooManyLevelsError(AstroidImportError): 18 | level: Any = ... 19 | name: Any = ... 20 | def __init__(self, message: str = ..., **kws: Any) -> None: ... 21 | 22 | class AstroidSyntaxError(AstroidBuildingError): ... 23 | 24 | class NoDefault(AstroidError): 25 | func: Any = ... 26 | name: Any = ... 27 | def __init__(self, message: str = ..., **kws: Any) -> None: ... 28 | 29 | class ResolveError(AstroidError): 30 | context: Any = ... 31 | 32 | class MroError(ResolveError): 33 | mros: Any = ... 34 | cls: Any = ... 35 | 36 | class DuplicateBasesError(MroError): ... 37 | class InconsistentMroError(MroError): ... 38 | 39 | class SuperError(ResolveError): 40 | super_: Any = ... 41 | 42 | class InferenceError(ResolveError): 43 | node: Any = ... 44 | context: Any = ... 45 | def __init__(self, message: str = ..., **kws: Any) -> None: ... 46 | 47 | class NameInferenceError(InferenceError): 48 | name: Any = ... 49 | scope: Any = ... 50 | def __init__(self, message: str = ..., **kws: Any) -> None: ... 51 | 52 | class AttributeInferenceError(ResolveError): 53 | target: Any = ... 54 | attribute: Any = ... 55 | def __init__(self, message: str = ..., **kws: Any) -> None: ... 56 | 57 | class UseInferenceDefault(Exception): ... 58 | class _NonDeducibleTypeHierarchy(Exception): ... 59 | class AstroidIndexError(AstroidError): ... 60 | class AstroidTypeError(AstroidError): ... 61 | class InferenceOverwriteError(AstroidError): ... 62 | OperationError = util.BadOperationMessage 63 | UnaryOperationError = util.BadUnaryOperationMessage 64 | BinaryOperationError = util.BadBinaryOperationMessage 65 | SuperArgumentTypeError = SuperError 66 | UnresolvableName = NameInferenceError 67 | NotFoundError = AttributeInferenceError 68 | AstroidBuildingException = AstroidBuildingError 69 | -------------------------------------------------------------------------------- /stubs/astroid/helpers.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.helpers (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any, Optional 6 | 7 | BUILTINS: Any 8 | 9 | def object_type(node: Any, context: Optional[Any] = ...): ... 10 | def object_isinstance(node: Any, class_or_seq: Any, context: Optional[Any] = ...): ... 11 | def object_issubclass(node: Any, class_or_seq: Any, context: Optional[Any] = ...): ... 12 | def safe_infer(node: Any, context: Optional[Any] = ...): ... 13 | def has_known_bases(klass: Any, context: Optional[Any] = ...): ... 14 | def is_subtype(type1: Any, type2: Any): ... 15 | def is_supertype(type1: Any, type2: Any): ... 16 | def class_instance_as_index(node: Any): ... 17 | def object_len(node: Any, context: Optional[Any] = ...): ... 18 | -------------------------------------------------------------------------------- /stubs/astroid/inference.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.inference (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any, Optional 6 | 7 | MANAGER: Any 8 | 9 | def infer_end(self, context: Optional[Any] = ...) -> None: ... 10 | def infer_sequence(self, context: Optional[Any] = ...) -> None: ... 11 | def infer_map(self, context: Optional[Any] = ...) -> None: ... 12 | def infer_name(self, context: Optional[Any] = ...): ... 13 | def infer_call(self, context: Optional[Any] = ...): ... 14 | def infer_import(self, context: Optional[Any] = ..., asname: bool = ...) -> None: ... 15 | def infer_import_from(self, context: Optional[Any] = ..., asname: bool = ...): ... 16 | def infer_attribute(self, context: Optional[Any] = ...): ... 17 | def infer_global(self, context: Optional[Any] = ...): ... 18 | def infer_subscript(self, context: Optional[Any] = ...): ... 19 | def infer_unaryop(self, context: Optional[Any] = ...): ... 20 | def infer_binop(self, context: Optional[Any] = ...): ... 21 | def infer_augassign(self, context: Optional[Any] = ...): ... 22 | def infer_arguments(self, context: Optional[Any] = ...): ... 23 | def infer_assign(self, context: Optional[Any] = ...): ... 24 | def infer_empty_node(self, context: Optional[Any] = ...) -> None: ... 25 | def infer_index(self, context: Optional[Any] = ...): ... 26 | def instance_getitem(self, index: Any, context: Optional[Any] = ...): ... 27 | -------------------------------------------------------------------------------- /stubs/astroid/interpreter/__init__.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.interpreter (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | -------------------------------------------------------------------------------- /stubs/astroid/interpreter/_import/__init__.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.interpreter._import (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | -------------------------------------------------------------------------------- /stubs/astroid/interpreter/_import/spec.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.interpreter._import.spec (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | import abc 6 | from collections import namedtuple 7 | from typing import Any, Optional 8 | 9 | ModuleType: Any 10 | 11 | _ModuleSpec = namedtuple('_ModuleSpec', 'name type location origin submodule_search_locations') 12 | 13 | class ModuleSpec(_ModuleSpec): 14 | def __new__(cls, name: Any, module_type: Any, location: Optional[Any] = ..., origin: Optional[Any] = ..., submodule_search_locations: Optional[Any] = ...): ... 15 | 16 | class Finder(metaclass=abc.ABCMeta): 17 | def __init__(self, path: Optional[Any] = ...) -> None: ... 18 | @abc.abstractmethod 19 | def find_module(self, modname: Any, module_parts: Any, processed: Any, submodule_path: Any) -> Any: ... 20 | def contribute_to_path(self, spec: Any, processed: Any) -> None: ... 21 | 22 | class ImpFinder(Finder): 23 | def find_module(self, modname: Any, module_parts: Any, processed: Any, submodule_path: Any): ... 24 | def contribute_to_path(self, spec: Any, processed: Any): ... 25 | 26 | class ExplicitNamespacePackageFinder(ImpFinder): 27 | def find_module(self, modname: Any, module_parts: Any, processed: Any, submodule_path: Any): ... 28 | def contribute_to_path(self, spec: Any, processed: Any): ... 29 | 30 | class ZipFinder(Finder): 31 | def __init__(self, path: Any) -> None: ... 32 | def find_module(self, modname: Any, module_parts: Any, processed: Any, submodule_path: Any): ... 33 | 34 | class PathSpecFinder(Finder): 35 | def find_module(self, modname: Any, module_parts: Any, processed: Any, submodule_path: Any): ... 36 | def contribute_to_path(self, spec: Any, processed: Any): ... 37 | 38 | def find_spec(modpath: Any, path: Optional[Any] = ...): ... 39 | -------------------------------------------------------------------------------- /stubs/astroid/interpreter/_import/util.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.interpreter._import.util (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any 6 | 7 | def is_namespace(modname: Any): ... 8 | -------------------------------------------------------------------------------- /stubs/astroid/interpreter/dunder_lookup.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.interpreter.dunder_lookup (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any 6 | 7 | def lookup(node: Any, name: Any): ... 8 | -------------------------------------------------------------------------------- /stubs/astroid/interpreter/objectmodel.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.interpreter.objectmodel (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any, Optional 6 | 7 | IMPL_PREFIX: str 8 | 9 | class ObjectModel: 10 | def __init__(self) -> None: ... 11 | def __call__(self, instance: Any): ... 12 | def __get__(self, instance: Any, cls: Optional[Any] = ...): ... 13 | def __contains__(self, name: Any): ... 14 | def attributes(self): ... 15 | def lookup(self, name: Any): ... 16 | 17 | class ModuleModel(ObjectModel): 18 | @property 19 | def attr_builtins(self): ... 20 | @property 21 | def attr___path__(self): ... 22 | @property 23 | def attr___name__(self): ... 24 | @property 25 | def attr___doc__(self): ... 26 | @property 27 | def attr___file__(self): ... 28 | @property 29 | def attr___dict__(self): ... 30 | @property 31 | def attr___package__(self): ... 32 | @property 33 | def attr___spec__(self): ... 34 | @property 35 | def attr___loader__(self): ... 36 | @property 37 | def attr___cached__(self): ... 38 | 39 | class FunctionModel(ObjectModel): 40 | @property 41 | def attr___name__(self): ... 42 | @property 43 | def attr___doc__(self): ... 44 | @property 45 | def attr___qualname__(self): ... 46 | @property 47 | def attr___defaults__(self): ... 48 | @property 49 | def attr___annotations__(self): ... 50 | @property 51 | def attr___dict__(self): ... 52 | attr___globals__: Any = ... 53 | @property 54 | def attr___kwdefaults__(self): ... 55 | @property 56 | def attr___module__(self): ... 57 | @property 58 | def attr___get__(self): ... 59 | @property 60 | def attr___ne__(self): ... 61 | attr___subclasshook__: Any = ... 62 | attr___str__: Any = ... 63 | attr___sizeof__: Any = ... 64 | attr___setattr___: Any = ... 65 | attr___repr__: Any = ... 66 | attr___reduce__: Any = ... 67 | attr___reduce_ex__: Any = ... 68 | attr___new__: Any = ... 69 | attr___lt__: Any = ... 70 | attr___eq__: Any = ... 71 | attr___gt__: Any = ... 72 | attr___format__: Any = ... 73 | attr___delattr___: Any = ... 74 | attr___getattribute__: Any = ... 75 | attr___hash__: Any = ... 76 | attr___init__: Any = ... 77 | attr___dir__: Any = ... 78 | attr___call__: Any = ... 79 | attr___class__: Any = ... 80 | attr___closure__: Any = ... 81 | attr___code__: Any = ... 82 | 83 | class ClassModel(ObjectModel): 84 | @property 85 | def attr___module__(self): ... 86 | @property 87 | def attr___name__(self): ... 88 | @property 89 | def attr___qualname__(self): ... 90 | @property 91 | def attr___doc__(self): ... 92 | @property 93 | def attr___mro__(self): ... 94 | @property 95 | def attr_mro(self): ... 96 | @property 97 | def attr___bases__(self): ... 98 | @property 99 | def attr___class__(self): ... 100 | @property 101 | def attr___subclasses__(self): ... 102 | @property 103 | def attr___dict__(self): ... 104 | 105 | class SuperModel(ObjectModel): 106 | @property 107 | def attr___thisclass__(self): ... 108 | @property 109 | def attr___self_class__(self): ... 110 | @property 111 | def attr___self__(self): ... 112 | @property 113 | def attr___class__(self): ... 114 | 115 | class UnboundMethodModel(ObjectModel): 116 | @property 117 | def attr___class__(self): ... 118 | @property 119 | def attr___func__(self): ... 120 | @property 121 | def attr___self__(self): ... 122 | attr_im_func: Any = ... 123 | attr_im_class: Any = ... 124 | attr_im_self: Any = ... 125 | 126 | class BoundMethodModel(FunctionModel): 127 | @property 128 | def attr___func__(self): ... 129 | @property 130 | def attr___self__(self): ... 131 | 132 | class GeneratorModel(FunctionModel): 133 | def __new__(cls, *args: Any, **kwargs: Any): ... 134 | @property 135 | def attr___name__(self): ... 136 | @property 137 | def attr___doc__(self): ... 138 | 139 | class AsyncGeneratorModel(GeneratorModel): 140 | def __new__(cls, *args: Any, **kwargs: Any): ... 141 | 142 | class InstanceModel(ObjectModel): 143 | @property 144 | def attr___class__(self): ... 145 | @property 146 | def attr___module__(self): ... 147 | @property 148 | def attr___doc__(self): ... 149 | @property 150 | def attr___dict__(self): ... 151 | 152 | class ExceptionInstanceModel(InstanceModel): 153 | @property 154 | def attr_args(self): ... 155 | @property 156 | def attr___traceback__(self): ... 157 | 158 | class SyntaxErrorInstanceModel(ExceptionInstanceModel): 159 | @property 160 | def attr_text(self): ... 161 | 162 | class OSErrorInstanceModel(ExceptionInstanceModel): 163 | @property 164 | def attr_filename(self): ... 165 | @property 166 | def attr_errno(self): ... 167 | @property 168 | def attr_strerror(self): ... 169 | attr_filename2: Any = ... 170 | 171 | class ImportErrorInstanceModel(ExceptionInstanceModel): 172 | @property 173 | def attr_name(self): ... 174 | @property 175 | def attr_path(self): ... 176 | 177 | BUILTIN_EXCEPTIONS: Any 178 | 179 | class DictModel(ObjectModel): 180 | @property 181 | def attr___class__(self): ... 182 | @property 183 | def attr_items(self): ... 184 | @property 185 | def attr_keys(self): ... 186 | @property 187 | def attr_values(self): ... 188 | -------------------------------------------------------------------------------- /stubs/astroid/manager.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.manager (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any, Optional 6 | 7 | def safe_repr(obj: Any): ... 8 | 9 | class AstroidManager: 10 | name: str = ... 11 | brain: Any = ... 12 | __dict__: Any = ... 13 | astroid_cache: Any = ... 14 | always_load_extensions: bool = ... 15 | optimize_ast: bool = ... 16 | extension_package_whitelist: Any = ... 17 | register_transform: Any = ... 18 | unregister_transform: Any = ... 19 | max_inferable_values: int = ... 20 | def __init__(self) -> None: ... 21 | @property 22 | def builtins_module(self): ... 23 | def visit_transforms(self, node: Any): ... 24 | def ast_from_file(self, filepath: Any, modname: Optional[Any] = ..., fallback: bool = ..., source: bool = ...): ... 25 | def ast_from_module_name(self, modname: Any, context_file: Optional[Any] = ...): ... 26 | def zip_import_data(self, filepath: Any): ... 27 | def file_from_module_name(self, modname: Any, contextfile: Any): ... 28 | def ast_from_module(self, module: Any, modname: Optional[Any] = ...): ... 29 | def ast_from_class(self, klass: Any, modname: Optional[Any] = ...): ... 30 | def infer_ast_from_something(self, obj: Any, context: Optional[Any] = ...) -> None: ... 31 | def register_failed_import_hook(self, hook: Any) -> None: ... 32 | def cache_module(self, module: Any) -> None: ... 33 | def bootstrap(self) -> None: ... 34 | def clear_cache(self) -> None: ... 35 | -------------------------------------------------------------------------------- /stubs/astroid/mixins.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.mixins (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from astroid.node_classes import NodeNG 6 | from typing import Any, Iterator, Optional 7 | 8 | class BlockRangeMixIn: 9 | def blockstart_tolineno(self) -> Any: ... 10 | 11 | class FilterStmtsMixin: 12 | def assign_type(self) -> Any: ... 13 | 14 | class AssignTypeMixin: 15 | def assign_type(self) -> Any: ... 16 | 17 | class ParentAssignTypeMixin(AssignTypeMixin): 18 | def assign_type(self) -> Any: ... 19 | 20 | class ImportFromMixin(FilterStmtsMixin): 21 | def do_import_module(self, modname: Optional[Any] = ...) -> Any: ... 22 | def real_name(self, asname: Any) -> Any: ... 23 | 24 | class MultiLineBlockMixin: ... 25 | 26 | class NoChildrenMixin: 27 | def get_children(self) -> Iterator['NodeNG']: ... 28 | -------------------------------------------------------------------------------- /stubs/astroid/modutils.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.modutils (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from .interpreter._import import spec, util 6 | from typing import Any, Optional 7 | 8 | PY_SOURCE_EXTS: Any 9 | PY_COMPILED_EXTS: Any 10 | STD_LIB_DIRS: Any 11 | prefix: Any 12 | EXT_LIB_DIR: Any 13 | IS_JYTHON: Any 14 | BUILTIN_MODULES: Any 15 | 16 | class NoSourceFile(Exception): ... 17 | 18 | def load_module_from_name(dotted_name: Any, path: Optional[Any] = ..., use_sys: bool = ...): ... 19 | def load_module_from_modpath(parts: Any, path: Optional[Any] = ..., use_sys: int = ...): ... 20 | def load_module_from_file(filepath: Any, path: Optional[Any] = ..., use_sys: bool = ..., extrapath: Optional[Any] = ...): ... 21 | def check_modpath_has_init(path: Any, mod_path: Any): ... 22 | def modpath_from_file_with_callback(filename: Any, extrapath: Optional[Any] = ..., is_package_cb: Optional[Any] = ...): ... 23 | def modpath_from_file(filename: Any, extrapath: Optional[Any] = ...): ... 24 | def file_from_modpath(modpath: Any, path: Optional[Any] = ..., context_file: Optional[Any] = ...): ... 25 | def file_info_from_modpath(modpath: Any, path: Optional[Any] = ..., context_file: Optional[Any] = ...): ... 26 | def get_module_part(dotted_name: Any, context_file: Optional[Any] = ...): ... 27 | def get_module_files(src_directory: Any, blacklist: Any, list_all: bool = ...): ... 28 | def get_source_file(filename: Any, include_no_ext: bool = ...): ... 29 | def is_python_source(filename: Any): ... 30 | def is_standard_module(modname: Any, std_path: Optional[Any] = ...): ... 31 | def is_relative(modname: Any, from_file: Any): ... 32 | def is_namespace(specobj: Any): ... 33 | def is_directory(specobj: Any): ... 34 | -------------------------------------------------------------------------------- /stubs/astroid/node_classes.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.node_classes (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | import abc 6 | from astroid import bases, mixins 7 | from astroid.scoped_nodes import ClassDef as ClassDef 8 | from typing import Any, Iterator, Optional 9 | 10 | BUILTINS: Any 11 | MANAGER: Any 12 | 13 | def unpack_infer(stmt: Any, context: Optional[Any] = ...) -> Any: ... 14 | def are_exclusive(stmt1: Any, stmt2: Any, exceptions: Optional[Any] = ...) -> Any: ... 15 | 16 | OP_PRECEDENCE: Any 17 | 18 | class NodeNG: 19 | is_statement: bool = ... 20 | optional_assign: bool = ... 21 | is_function: bool = ... 22 | is_lambda: bool = ... 23 | lineno: Any = ... 24 | col_offset: Any = ... 25 | parent: Any = ... 26 | def __init__(self, lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 27 | def infer(self, context: Optional[Any] = ..., **kwargs: Any) -> Any: ... 28 | def accept(self, visitor: Any) -> Any: ... 29 | def get_children(self) -> Iterator[NodeNG]: ... 30 | def last_child(self) -> Any: ... 31 | def parent_of(self, node: Any) -> Any: ... 32 | def statement(self) -> Any: ... 33 | def frame(self) -> Any: ... 34 | def scope(self) -> Any: ... 35 | def root(self) -> Any: ... 36 | def child_sequence(self, child: Any) -> Any: ... 37 | def locate_child(self, child: Any) -> Any: ... 38 | def next_sibling(self) -> Any: ... 39 | def previous_sibling(self) -> Any: ... 40 | def nearest(self, nodes: Any) -> Any: ... 41 | def fromlineno(self) -> Any: ... 42 | def tolineno(self) -> Any: ... 43 | def block_range(self, lineno: Any) -> Any: ... 44 | def set_local(self, name: Any, stmt: Any) -> None: ... 45 | def nodes_of_class(self, klass: Any, skip_klass: Optional[Any] = ...) -> None: ... 46 | def inferred(self) -> Any: ... 47 | def instantiate_class(self) -> Any: ... 48 | def has_base(self, node: Any) -> Any: ... 49 | def callable(self) -> Any: ... 50 | def eq(self, value: Any) -> Any: ... 51 | def as_string(self) -> Any: ... 52 | def repr_tree(self, ids: bool = ..., include_linenos: bool = ..., ast_state: bool = ..., indent: str = ..., max_depth: int = ..., max_width: int = ...) -> Any: ... 53 | def bool_value(self) -> Any: ... 54 | def op_precedence(self) -> Any: ... 55 | def op_left_associative(self) -> Any: ... 56 | 57 | class Statement(NodeNG): 58 | is_statement: bool = ... 59 | def next_sibling(self) -> Any: ... 60 | def previous_sibling(self) -> Any: ... 61 | 62 | class _BaseContainer(mixins.ParentAssignTypeMixin, NodeNG, bases.Instance, metaclass=abc.ABCMeta): 63 | elts: Any = ... 64 | def __init__(self, lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 65 | def postinit(self, elts: Any) -> None: ... 66 | @classmethod 67 | def from_constants(cls, elts: Optional[Any] = ...) -> Any: ... 68 | def itered(self) -> Any: ... 69 | def bool_value(self) -> Any: ... 70 | @abc.abstractmethod 71 | def pytype(self) -> Any: ... 72 | def get_children(self) -> Iterator[NodeNG]: ... 73 | 74 | class LookupMixIn: 75 | def lookup(self, name: Any) -> Any: ... 76 | def ilookup(self, name: Any) -> Any: ... 77 | 78 | class AssignName(mixins.NoChildrenMixin, LookupMixIn, mixins.ParentAssignTypeMixin, NodeNG): 79 | name: Any = ... 80 | def __init__(self, name: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 81 | 82 | class DelName(mixins.NoChildrenMixin, LookupMixIn, mixins.ParentAssignTypeMixin, NodeNG): 83 | name: Any = ... 84 | def __init__(self, name: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 85 | 86 | class Name(mixins.NoChildrenMixin, LookupMixIn, NodeNG): 87 | name: Any = ... 88 | def __init__(self, name: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 89 | 90 | class Arguments(mixins.AssignTypeMixin, NodeNG): 91 | varargannotation: Any = ... 92 | kwargannotation: Any = ... 93 | vararg: Any = ... 94 | kwarg: Any = ... 95 | args: Any = ... 96 | defaults: Any = ... 97 | kwonlyargs: Any = ... 98 | kw_defaults: Any = ... 99 | annotations: Any = ... 100 | kwonlyargs_annotations: Any = ... 101 | def __init__(self, vararg: Optional[Any] = ..., kwarg: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 102 | def postinit(self, args: Any, defaults: Any, kwonlyargs: Any, kw_defaults: Any, annotations: Any, kwonlyargs_annotations: Optional[Any] = ..., varargannotation: Optional[Any] = ..., kwargannotation: Optional[Any] = ...) -> None: ... 103 | def fromlineno(self) -> Any: ... 104 | def format_args(self) -> Any: ... 105 | def default_value(self, argname: Any) -> Any: ... 106 | def is_argument(self, name: Any) -> Any: ... 107 | def find_argname(self, argname: Any, rec: bool = ...) -> Any: ... 108 | def get_children(self) -> Iterator[NodeNG]: ... 109 | 110 | class AssignAttr(mixins.ParentAssignTypeMixin, NodeNG): 111 | expr: Any = ... 112 | attrname: Any = ... 113 | def __init__(self, attrname: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 114 | def postinit(self, expr: Optional[Any] = ...) -> None: ... 115 | def get_children(self) -> Iterator[NodeNG]: ... 116 | 117 | class Assert(Statement): 118 | test: Any = ... 119 | fail: Any = ... 120 | def postinit(self, test: Optional[Any] = ..., fail: Optional[Any] = ...) -> None: ... 121 | def get_children(self) -> Iterator[NodeNG]: ... 122 | 123 | class Assign(mixins.AssignTypeMixin, Statement): 124 | targets: Any = ... 125 | value: Any = ... 126 | type_annotation: Any = ... 127 | def postinit(self, targets: Optional[Any] = ..., value: Optional[Any] = ..., type_annotation: Optional[Any] = ...) -> None: ... 128 | def get_children(self) -> Iterator[NodeNG]: ... 129 | 130 | class AnnAssign(mixins.AssignTypeMixin, Statement): 131 | target: Any = ... 132 | annotation: Any = ... 133 | value: Any = ... 134 | simple: Any = ... 135 | def postinit(self, target: Any, annotation: Any, simple: Any, value: Optional[Any] = ...) -> None: ... 136 | def get_children(self) -> Iterator[NodeNG]: ... 137 | 138 | class AugAssign(mixins.AssignTypeMixin, Statement): 139 | target: Any = ... 140 | value: Any = ... 141 | op: Any = ... 142 | def __init__(self, op: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 143 | def postinit(self, target: Optional[Any] = ..., value: Optional[Any] = ...) -> None: ... 144 | def type_errors(self, context: Optional[Any] = ...) -> Any: ... 145 | def get_children(self) -> Iterator[NodeNG]: ... 146 | 147 | class Repr(NodeNG): 148 | value: Any = ... 149 | def postinit(self, value: Optional[Any] = ...) -> None: ... 150 | 151 | class BinOp(NodeNG): 152 | left: Any = ... 153 | right: Any = ... 154 | op: Any = ... 155 | def __init__(self, op: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 156 | def postinit(self, left: Optional[Any] = ..., right: Optional[Any] = ...) -> None: ... 157 | def type_errors(self, context: Optional[Any] = ...) -> Any: ... 158 | def get_children(self) -> Iterator[NodeNG]: ... 159 | def op_precedence(self) -> Any: ... 160 | def op_left_associative(self) -> Any: ... 161 | 162 | class BoolOp(NodeNG): 163 | values: Any = ... 164 | op: Any = ... 165 | def __init__(self, op: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 166 | def postinit(self, values: Optional[Any] = ...) -> None: ... 167 | def get_children(self) -> Iterator[NodeNG]: ... 168 | def op_precedence(self) -> Any: ... 169 | 170 | class Break(mixins.NoChildrenMixin, Statement): ... 171 | 172 | class Call(NodeNG): 173 | func: Optional[NodeNG] = ... 174 | args: Any = ... 175 | keywords: Any = ... 176 | def postinit(self, func: Optional[Any] = ..., args: Optional[Any] = ..., keywords: Optional[Any] = ...) -> None: ... 177 | @property 178 | def starargs(self) -> Any: ... 179 | @property 180 | def kwargs(self) -> Any: ... 181 | def get_children(self) -> Iterator[NodeNG]: ... 182 | 183 | class Compare(NodeNG): 184 | left: Any = ... 185 | ops: Any = ... 186 | def postinit(self, left: Optional[Any] = ..., ops: Optional[Any] = ...) -> None: ... 187 | def get_children(self) -> Iterator[NodeNG]: ... 188 | def last_child(self) -> Any: ... 189 | 190 | class Comprehension(NodeNG): 191 | target: Any = ... 192 | iter: Any = ... 193 | ifs: Any = ... 194 | is_async: Any = ... 195 | parent: Any = ... 196 | def __init__(self, parent: Optional[Any] = ...) -> None: ... 197 | def postinit(self, target: Optional[Any] = ..., iter: Optional[Any] = ..., ifs: Optional[Any] = ..., is_async: Optional[Any] = ...) -> None: ... 198 | optional_assign: bool = ... 199 | def assign_type(self) -> Any: ... 200 | def get_children(self) -> Iterator[NodeNG]: ... 201 | 202 | class Const(mixins.NoChildrenMixin, NodeNG, bases.Instance): 203 | value: Any = ... 204 | def __init__(self, value: Any, lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 205 | def __getattr__(self, name: Any) -> Any: ... 206 | def getitem(self, index: Any, context: Optional[Any] = ...) -> Any: ... 207 | def has_dynamic_getattr(self) -> Any: ... 208 | def itered(self) -> Any: ... 209 | def pytype(self) -> Any: ... 210 | def bool_value(self) -> Any: ... 211 | 212 | class Continue(mixins.NoChildrenMixin, Statement): ... 213 | 214 | class Decorators(NodeNG): 215 | nodes: Any = ... 216 | def postinit(self, nodes: Any) -> None: ... 217 | def scope(self) -> Any: ... 218 | def get_children(self) -> Iterator[NodeNG]: ... 219 | 220 | class DelAttr(mixins.ParentAssignTypeMixin, NodeNG): 221 | expr: Any = ... 222 | attrname: Any = ... 223 | def __init__(self, attrname: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 224 | def postinit(self, expr: Optional[Any] = ...) -> None: ... 225 | def get_children(self) -> Iterator[NodeNG]: ... 226 | 227 | class Delete(mixins.AssignTypeMixin, Statement): 228 | targets: Any = ... 229 | def postinit(self, targets: Optional[Any] = ...) -> None: ... 230 | def get_children(self) -> Iterator[NodeNG]: ... 231 | 232 | class Dict(NodeNG, bases.Instance): 233 | items: Any = ... 234 | def __init__(self, lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 235 | def postinit(self, items: Any) -> None: ... 236 | @classmethod 237 | def from_constants(cls, items: Optional[Any] = ...) -> Any: ... 238 | def pytype(self) -> Any: ... 239 | def get_children(self) -> Iterator[NodeNG]: ... 240 | def last_child(self) -> Any: ... 241 | def itered(self) -> Any: ... 242 | def getitem(self, index: Any, context: Optional[Any] = ...) -> Any: ... 243 | def bool_value(self) -> Any: ... 244 | 245 | class Expr(Statement): 246 | value: Any = ... 247 | def postinit(self, value: Optional[Any] = ...) -> None: ... 248 | def get_children(self) -> Iterator[NodeNG]: ... 249 | 250 | class Ellipsis(mixins.NoChildrenMixin, NodeNG): 251 | def bool_value(self) -> Any: ... 252 | 253 | class EmptyNode(mixins.NoChildrenMixin, NodeNG): 254 | object: Any = ... 255 | 256 | class ExceptHandler(mixins.MultiLineBlockMixin, mixins.AssignTypeMixin, Statement): 257 | type: Any = ... 258 | name: Any = ... 259 | body: Any = ... 260 | def get_children(self) -> Iterator[NodeNG]: ... 261 | def postinit(self, type: Optional[Any] = ..., name: Optional[Any] = ..., body: Optional[Any] = ...) -> None: ... 262 | def blockstart_tolineno(self) -> Any: ... 263 | def catch(self, exceptions: Any) -> Any: ... 264 | 265 | class Exec(Statement): 266 | expr: Any = ... 267 | globals: Any = ... 268 | locals: Any = ... 269 | def postinit(self, expr: Optional[Any] = ..., globals: Optional[Any] = ..., locals: Optional[Any] = ...) -> None: ... 270 | 271 | class ExtSlice(NodeNG): 272 | dims: Any = ... 273 | def postinit(self, dims: Optional[Any] = ...) -> None: ... 274 | 275 | class For(mixins.MultiLineBlockMixin, mixins.BlockRangeMixIn, mixins.AssignTypeMixin, Statement): 276 | target: Any = ... 277 | iter: Any = ... 278 | body: Any = ... 279 | orelse: Any = ... 280 | type_annotation: Any = ... 281 | def postinit(self, target: Optional[Any] = ..., iter: Optional[Any] = ..., body: Optional[Any] = ..., orelse: Optional[Any] = ..., type_annotation: Optional[Any] = ...) -> None: ... 282 | optional_assign: bool = ... 283 | def blockstart_tolineno(self) -> Any: ... 284 | def get_children(self) -> Iterator[NodeNG]: ... 285 | 286 | class AsyncFor(For): ... 287 | 288 | class Await(NodeNG): 289 | value: Any = ... 290 | def postinit(self, value: Optional[Any] = ...) -> None: ... 291 | def get_children(self) -> Iterator[NodeNG]: ... 292 | 293 | class ImportFrom(mixins.NoChildrenMixin, mixins.ImportFromMixin, Statement): 294 | modname: Any = ... 295 | names: Any = ... 296 | level: Any = ... 297 | def __init__(self, fromname: Any, names: Any, level: int = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 298 | 299 | class Attribute(NodeNG): 300 | expr: Any = ... 301 | attrname: Any = ... 302 | def __init__(self, attrname: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 303 | def postinit(self, expr: Optional[Any] = ...) -> None: ... 304 | def get_children(self) -> Iterator[NodeNG]: ... 305 | 306 | class Global(mixins.NoChildrenMixin, Statement): 307 | names: Any = ... 308 | def __init__(self, names: Any, lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 309 | 310 | class If(mixins.MultiLineBlockMixin, mixins.BlockRangeMixIn, Statement): 311 | test: Any = ... 312 | body: Any = ... 313 | orelse: Any = ... 314 | def postinit(self, test: Optional[Any] = ..., body: Optional[Any] = ..., orelse: Optional[Any] = ...) -> None: ... 315 | def blockstart_tolineno(self) -> Any: ... 316 | def block_range(self, lineno: Any) -> Any: ... 317 | def get_children(self) -> Iterator[NodeNG]: ... 318 | def has_elif_block(self) -> Any: ... 319 | 320 | class IfExp(NodeNG): 321 | test: Any = ... 322 | body: Any = ... 323 | orelse: Any = ... 324 | def postinit(self, test: Optional[Any] = ..., body: Optional[Any] = ..., orelse: Optional[Any] = ...) -> None: ... 325 | def get_children(self) -> Iterator[NodeNG]: ... 326 | def op_left_associative(self) -> Any: ... 327 | 328 | class Import(mixins.NoChildrenMixin, mixins.ImportFromMixin, Statement): 329 | names: Any = ... 330 | def __init__(self, names: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 331 | 332 | class Index(NodeNG): 333 | value: Any = ... 334 | def postinit(self, value: Optional[Any] = ...) -> None: ... 335 | def get_children(self) -> Iterator[NodeNG]: ... 336 | 337 | class Keyword(NodeNG): 338 | value: Any = ... 339 | arg: Any = ... 340 | def __init__(self, arg: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 341 | def postinit(self, value: Optional[Any] = ...) -> None: ... 342 | def get_children(self) -> Iterator[NodeNG]: ... 343 | 344 | class List(_BaseContainer): 345 | ctx: Any = ... 346 | def __init__(self, ctx: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 347 | def pytype(self) -> Any: ... 348 | def getitem(self, index: Any, context: Optional[Any] = ...) -> Any: ... 349 | 350 | class Nonlocal(mixins.NoChildrenMixin, Statement): 351 | names: Any = ... 352 | def __init__(self, names: Any, lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 353 | 354 | class Pass(mixins.NoChildrenMixin, Statement): ... 355 | 356 | class Print(Statement): 357 | dest: Any = ... 358 | values: Any = ... 359 | nl: Any = ... 360 | def __init__(self, nl: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 361 | def postinit(self, dest: Optional[Any] = ..., values: Optional[Any] = ...) -> None: ... 362 | 363 | class Raise(Statement): 364 | exc: Any = ... 365 | cause: Any = ... 366 | def postinit(self, exc: Optional[Any] = ..., cause: Optional[Any] = ...) -> None: ... 367 | def raises_not_implemented(self) -> Any: ... 368 | def get_children(self) -> Iterator[NodeNG]: ... 369 | 370 | class Return(Statement): 371 | value: Any = ... 372 | def postinit(self, value: Optional[Any] = ...) -> None: ... 373 | def get_children(self) -> Iterator[NodeNG]: ... 374 | def is_tuple_return(self) -> Any: ... 375 | 376 | class Set(_BaseContainer): 377 | def pytype(self) -> Any: ... 378 | 379 | class Slice(NodeNG): 380 | lower: Any = ... 381 | upper: Any = ... 382 | step: Any = ... 383 | def postinit(self, lower: Optional[Any] = ..., upper: Optional[Any] = ..., step: Optional[Any] = ...) -> None: ... 384 | def pytype(self) -> Any: ... 385 | def igetattr(self, attrname: Any, context: Optional[Any] = ...) -> None: ... 386 | def getattr(self, attrname: Any, context: Optional[Any] = ...) -> Any: ... 387 | def get_children(self) -> Iterator[NodeNG]: ... 388 | 389 | class Starred(mixins.ParentAssignTypeMixin, NodeNG): 390 | value: Any = ... 391 | ctx: Any = ... 392 | def __init__(self, ctx: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 393 | def postinit(self, value: Optional[Any] = ...) -> None: ... 394 | def get_children(self) -> Iterator[NodeNG]: ... 395 | 396 | class Subscript(NodeNG): 397 | value: Any = ... 398 | slice: Any = ... 399 | ctx: Any = ... 400 | def __init__(self, ctx: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 401 | def postinit(self, value: Optional[Any] = ..., slice: Optional[Any] = ...) -> None: ... 402 | def get_children(self) -> Iterator[NodeNG]: ... 403 | 404 | class TryExcept(mixins.MultiLineBlockMixin, mixins.BlockRangeMixIn, Statement): 405 | body: Any = ... 406 | handlers: Any = ... 407 | orelse: Any = ... 408 | def postinit(self, body: Optional[Any] = ..., handlers: Optional[Any] = ..., orelse: Optional[Any] = ...) -> None: ... 409 | def block_range(self, lineno: Any) -> Any: ... 410 | def get_children(self) -> Iterator[NodeNG]: ... 411 | 412 | class TryFinally(mixins.MultiLineBlockMixin, mixins.BlockRangeMixIn, Statement): 413 | body: Any = ... 414 | finalbody: Any = ... 415 | def postinit(self, body: Optional[Any] = ..., finalbody: Optional[Any] = ...) -> None: ... 416 | def block_range(self, lineno: Any) -> Any: ... 417 | def get_children(self) -> Iterator[NodeNG]: ... 418 | 419 | class Tuple(_BaseContainer): 420 | ctx: Any = ... 421 | def __init__(self, ctx: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 422 | def pytype(self) -> Any: ... 423 | def getitem(self, index: Any, context: Optional[Any] = ...) -> Any: ... 424 | 425 | class UnaryOp(NodeNG): 426 | operand: Any = ... 427 | op: Any = ... 428 | def __init__(self, op: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 429 | def postinit(self, operand: Optional[Any] = ...) -> None: ... 430 | def type_errors(self, context: Optional[Any] = ...) -> Any: ... 431 | def get_children(self) -> Iterator[NodeNG]: ... 432 | def op_precedence(self) -> Any: ... 433 | 434 | class While(mixins.MultiLineBlockMixin, mixins.BlockRangeMixIn, Statement): 435 | test: Any = ... 436 | body: Any = ... 437 | orelse: Any = ... 438 | def postinit(self, test: Optional[Any] = ..., body: Optional[Any] = ..., orelse: Optional[Any] = ...) -> None: ... 439 | def blockstart_tolineno(self) -> Any: ... 440 | def block_range(self, lineno: Any) -> Any: ... 441 | def get_children(self) -> Iterator[NodeNG]: ... 442 | 443 | class With(mixins.MultiLineBlockMixin, mixins.BlockRangeMixIn, mixins.AssignTypeMixin, Statement): 444 | items: Any = ... 445 | body: Any = ... 446 | type_annotation: Any = ... 447 | def postinit(self, items: Optional[Any] = ..., body: Optional[Any] = ..., type_annotation: Optional[Any] = ...) -> None: ... 448 | def blockstart_tolineno(self) -> Any: ... 449 | def get_children(self) -> Iterator[NodeNG]: ... 450 | 451 | class AsyncWith(With): ... 452 | 453 | class Yield(NodeNG): 454 | value: Any = ... 455 | def postinit(self, value: Optional[Any] = ...) -> None: ... 456 | def get_children(self) -> Iterator[NodeNG]: ... 457 | 458 | class YieldFrom(Yield): ... 459 | class DictUnpack(mixins.NoChildrenMixin, NodeNG): ... 460 | 461 | class FormattedValue(NodeNG): 462 | value: Any = ... 463 | conversion: Any = ... 464 | format_spec: Any = ... 465 | def postinit(self, value: Any, conversion: Optional[Any] = ..., format_spec: Optional[Any] = ...) -> None: ... 466 | def get_children(self) -> Iterator[NodeNG]: ... 467 | 468 | class JoinedStr(NodeNG): 469 | values: Any = ... 470 | def postinit(self, values: Optional[Any] = ...) -> None: ... 471 | def get_children(self) -> Iterator[NodeNG]: ... 472 | 473 | class Unknown(mixins.AssignTypeMixin, NodeNG): 474 | name: str = ... 475 | def qname(self) -> Any: ... 476 | def infer(self, context: Optional[Any] = ..., **kwargs: Any) -> None: ... 477 | 478 | CONST_CLS: Any 479 | 480 | def const_factory(value: Any) -> Any: ... 481 | def is_from_decorator(node: Any) -> Any: ... 482 | -------------------------------------------------------------------------------- /stubs/astroid/nodes.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.nodes (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any 6 | 7 | from astroid.node_classes import ( 8 | Arguments as Arguments, 9 | AssignAttr as AssignAttr, 10 | Assert as Assert, 11 | Assign as Assign, 12 | AnnAssign as AnnAssign, 13 | AssignName as AssignName, 14 | AugAssign as AugAssign, 15 | Repr as Repr, 16 | BinOp as BinOp, 17 | BoolOp as BoolOp, 18 | Break as Break, 19 | Call as Call, 20 | Compare as Compare, 21 | Comprehension as Comprehension, 22 | Const as Const, 23 | Continue as Continue, 24 | Decorators as Decorators, 25 | DelAttr as DelAttr, 26 | DelName as DelName, 27 | Delete as Delete, 28 | Dict as Dict, 29 | Expr as Expr, 30 | Ellipsis as Ellipsis, 31 | EmptyNode as EmptyNode, 32 | ExceptHandler as ExceptHandler, 33 | Exec as Exec, 34 | ExtSlice as ExtSlice, 35 | For as For, 36 | ImportFrom as ImportFrom, 37 | Attribute as Attribute, 38 | Global as Global, 39 | If as If, 40 | IfExp as IfExp, 41 | Import as Import, 42 | Index as Index, 43 | Keyword as Keyword, 44 | List as List, 45 | Name as Name, 46 | Nonlocal as Nonlocal, 47 | Pass as Pass, 48 | Print as Print, 49 | Raise as Raise, 50 | Return as Return, 51 | Set as Set, 52 | Slice as Slice, 53 | Starred as Starred, 54 | Subscript as Subscript, 55 | TryExcept as TryExcept, 56 | TryFinally as TryFinally, 57 | Tuple as Tuple, 58 | UnaryOp as UnaryOp, 59 | While as While, 60 | With as With, 61 | Yield as Yield, 62 | YieldFrom as YieldFrom, 63 | const_factory as const_factory, 64 | AsyncFor as AsyncFor, 65 | Await as Await, 66 | AsyncWith as AsyncWith, 67 | FormattedValue as FormattedValue, 68 | JoinedStr as JoinedStr, 69 | # Node not present in the builtin ast module. 70 | DictUnpack as DictUnpack, 71 | Unknown as Unknown, 72 | ) 73 | from astroid.scoped_nodes import ( 74 | Module as Module, 75 | GeneratorExp as GeneratorExp, 76 | Lambda as Lambda, 77 | DictComp as DictComp, 78 | ListComp as ListComp, 79 | SetComp as SetComp, 80 | FunctionDef as FunctionDef, 81 | ClassDef as ClassDef, 82 | AsyncFunctionDef as AsyncFunctionDef, 83 | ) 84 | 85 | ALL_NODE_CLASSES: Any 86 | -------------------------------------------------------------------------------- /stubs/astroid/objects.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.objects (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from astroid import bases, node_classes, scoped_nodes 6 | from typing import Any, Optional 7 | 8 | BUILTINS: Any 9 | objectmodel: Any 10 | 11 | class FrozenSet(node_classes._BaseContainer): 12 | def pytype(self): ... 13 | 14 | class Super(node_classes.NodeNG): 15 | special_attributes: Any = ... 16 | type: Any = ... 17 | mro_pointer: Any = ... 18 | def __init__(self, mro_pointer: Any, mro_type: Any, self_class: Any, scope: Any) -> None: ... 19 | def super_mro(self): ... 20 | def pytype(self): ... 21 | def display_type(self): ... 22 | @property 23 | def name(self): ... 24 | def qname(self): ... 25 | def igetattr(self, name: Any, context: Optional[Any] = ...) -> None: ... 26 | def getattr(self, name: Any, context: Optional[Any] = ...): ... 27 | 28 | class ExceptionInstance(bases.Instance): 29 | def special_attributes(self): ... 30 | 31 | class DictInstance(bases.Instance): 32 | special_attributes: Any = ... 33 | 34 | class DictItems(bases.Proxy): ... 35 | class DictKeys(bases.Proxy): ... 36 | class DictValues(bases.Proxy): ... 37 | 38 | class PartialFunction(scoped_nodes.FunctionDef): 39 | filled_positionals: Any = ... 40 | filled_args: Any = ... 41 | filled_keywords: Any = ... 42 | def __init__(self, call: Any, name: Optional[Any] = ..., doc: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 43 | def infer_call_result(self, caller: Optional[Any] = ..., context: Optional[Any] = ...): ... 44 | def qname(self): ... 45 | -------------------------------------------------------------------------------- /stubs/astroid/protocols.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.protocols (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any, Optional 6 | 7 | raw_building: Any 8 | objects: Any 9 | BIN_OP_METHOD: Any 10 | REFLECTED_BIN_OP_METHOD: Any 11 | AUGMENTED_OP_METHOD: Any 12 | UNARY_OP_METHOD: Any 13 | BIN_OP_IMPL: Any 14 | 15 | def const_infer_binary_op(self, opnode: Any, operator: Any, other: Any, context: Any, _: Any) -> None: ... 16 | def tl_infer_binary_op(self, opnode: Any, operator: Any, other: Any, context: Any, method: Any) -> None: ... 17 | def instance_class_infer_binary_op(self, opnode: Any, operator: Any, other: Any, context: Any, method: Any): ... 18 | def for_assigned_stmts(self, node: Optional[Any] = ..., context: Optional[Any] = ..., assign_path: Optional[Any] = ...): ... 19 | def sequence_assigned_stmts(self, node: Optional[Any] = ..., context: Optional[Any] = ..., assign_path: Optional[Any] = ...): ... 20 | def assend_assigned_stmts(self, node: Optional[Any] = ..., context: Optional[Any] = ..., assign_path: Optional[Any] = ...): ... 21 | def arguments_assigned_stmts(self, node: Optional[Any] = ..., context: Optional[Any] = ..., assign_path: Optional[Any] = ...): ... 22 | def assign_assigned_stmts(self, node: Optional[Any] = ..., context: Optional[Any] = ..., assign_path: Optional[Any] = ...): ... 23 | def assign_annassigned_stmts(self, node: Optional[Any] = ..., context: Optional[Any] = ..., assign_path: Optional[Any] = ...) -> None: ... 24 | def excepthandler_assigned_stmts(self, node: Optional[Any] = ..., context: Optional[Any] = ..., assign_path: Optional[Any] = ...): ... 25 | def with_assigned_stmts(self, node: Optional[Any] = ..., context: Optional[Any] = ..., assign_path: Optional[Any] = ...): ... 26 | def starred_assigned_stmts(self, node: Optional[Any] = ..., context: Optional[Any] = ..., assign_path: Optional[Any] = ...) -> None: ... 27 | -------------------------------------------------------------------------------- /stubs/astroid/raw_building.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.raw_building (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any, Optional 6 | 7 | MANAGER: Any 8 | 9 | def attach_dummy_node(node: Any, name: Any, runtime_object: Any = ...) -> None: ... 10 | def attach_const_node(node: Any, name: Any, value: Any) -> None: ... 11 | def attach_import_node(node: Any, modname: Any, membername: Any) -> None: ... 12 | def build_module(name: Any, doc: Optional[Any] = ...) -> Any: ... 13 | def build_class(name: Any, basenames: Any = ..., doc: Optional[Any] = ...) -> Any: ... 14 | def build_function(name: Any, args: Optional[Any] = ..., defaults: Optional[Any] = ..., doc: Optional[Any] = ...) -> Any: ... 15 | def build_from_import(fromname: Any, names: Any) -> Any: ... 16 | def register_arguments(func: Any, args: Optional[Any] = ...) -> None: ... 17 | def object_build_class(node: Any, member: Any, localname: Any) -> Any: ... 18 | def object_build_function(node: Any, member: Any, localname: Any) -> None: ... 19 | def object_build_datadescriptor(node: Any, member: Any, name: Any) -> Any: ... 20 | def object_build_methoddescriptor(node: Any, member: Any, localname: Any) -> None: ... 21 | 22 | class InspectBuilder: 23 | def __init__(self) -> None: ... 24 | def inspect_build(self, module: Any, modname: Optional[Any] = ..., path: Optional[Any] = ...) -> Any: ... 25 | def object_build(self, node: Any, obj: Any) -> Any: ... 26 | def imported_member(self, node: Any, member: Any, name: Any) -> Any: ... 27 | -------------------------------------------------------------------------------- /stubs/astroid/rebuilder.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.rebuilder (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any, Optional 6 | 7 | CONST_NAME_TRANSFORMS: Any 8 | REDIRECT: Any 9 | PY3: Any 10 | PY34: Any 11 | PY37: Any 12 | 13 | class TreeRebuilder: 14 | def __init__(self, manager: Any, parse_python_two: bool=...) -> Any: ... 15 | def visit_module(self, node: Any, modname: Any, modpath: Any, package: Any): ... 16 | def visit(self, node: Any, parent: Any): ... 17 | def visit_arguments(self, node: Any, parent: Any): ... 18 | def visit_assert(self, node: Any, parent: Any): ... 19 | def check_type_comment(self, node: Any): ... 20 | def check_function_type_comment(self, node: Any): ... 21 | def visit_assign(self, node: Any, parent: Any): ... 22 | def visit_assignname(self, node: Any, parent: Any, node_name: Optional[Any] = ...): ... 23 | def visit_augassign(self, node: Any, parent: Any): ... 24 | def visit_repr(self, node: Any, parent: Any): ... 25 | def visit_binop(self, node: Any, parent: Any): ... 26 | def visit_boolop(self, node: Any, parent: Any): ... 27 | def visit_break(self, node: Any, parent: Any): ... 28 | def visit_call(self, node: Any, parent: Any): ... 29 | def visit_classdef(self, node: Any, parent: Any, newstyle: Optional[Any] = ...): ... 30 | def visit_const(self, node: Any, parent: Any): ... 31 | def visit_continue(self, node: Any, parent: Any): ... 32 | def visit_compare(self, node: Any, parent: Any): ... 33 | def visit_comprehension(self, node: Any, parent: Any): ... 34 | def visit_decorators(self, node: Any, parent: Any): ... 35 | def visit_delete(self, node: Any, parent: Any): ... 36 | def visit_dict(self, node: Any, parent: Any): ... 37 | def visit_dictcomp(self, node: Any, parent: Any): ... 38 | def visit_expr(self, node: Any, parent: Any): ... 39 | def visit_ellipsis(self, node: Any, parent: Any): ... 40 | def visit_emptynode(self, node: Any, parent: Any): ... 41 | def visit_excepthandler(self, node: Any, parent: Any): ... 42 | def visit_exec(self, node: Any, parent: Any): ... 43 | def visit_extslice(self, node: Any, parent: Any): ... 44 | def visit_for(self, node: Any, parent: Any): ... 45 | def visit_importfrom(self, node: Any, parent: Any): ... 46 | def visit_functiondef(self, node: Any, parent: Any): ... 47 | def visit_generatorexp(self, node: Any, parent: Any): ... 48 | def visit_attribute(self, node: Any, parent: Any): ... 49 | def visit_global(self, node: Any, parent: Any): ... 50 | def visit_if(self, node: Any, parent: Any): ... 51 | def visit_ifexp(self, node: Any, parent: Any): ... 52 | def visit_import(self, node: Any, parent: Any): ... 53 | def visit_index(self, node: Any, parent: Any): ... 54 | def visit_keyword(self, node: Any, parent: Any): ... 55 | def visit_lambda(self, node: Any, parent: Any): ... 56 | def visit_list(self, node: Any, parent: Any): ... 57 | def visit_listcomp(self, node: Any, parent: Any): ... 58 | def visit_name(self, node: Any, parent: Any): ... 59 | def visit_constant(self, node: Any, parent: Any): ... 60 | def visit_str(self, node: Any, parent: Any): ... 61 | visit_bytes: Any = ... 62 | def visit_num(self, node: Any, parent: Any): ... 63 | def visit_pass(self, node: Any, parent: Any): ... 64 | def visit_print(self, node: Any, parent: Any): ... 65 | def visit_raise(self, node: Any, parent: Any): ... 66 | def visit_return(self, node: Any, parent: Any): ... 67 | def visit_set(self, node: Any, parent: Any): ... 68 | def visit_setcomp(self, node: Any, parent: Any): ... 69 | def visit_slice(self, node: Any, parent: Any): ... 70 | def visit_subscript(self, node: Any, parent: Any): ... 71 | def visit_tryexcept(self, node: Any, parent: Any): ... 72 | def visit_tryfinally(self, node: Any, parent: Any): ... 73 | def visit_tuple(self, node: Any, parent: Any): ... 74 | def visit_unaryop(self, node: Any, parent: Any): ... 75 | def visit_while(self, node: Any, parent: Any): ... 76 | def visit_with(self, node: Any, parent: Any): ... 77 | def visit_yield(self, node: Any, parent: Any): ... 78 | 79 | class TreeRebuilder3(TreeRebuilder): 80 | def visit_arg(self, node: Any, parent: Any): ... 81 | def visit_nameconstant(self, node: Any, parent: Any): ... 82 | def visit_excepthandler(self, node: Any, parent: Any): ... 83 | def visit_nonlocal(self, node: Any, parent: Any): ... 84 | def visit_raise(self, node: Any, parent: Any): ... 85 | def visit_starred(self, node: Any, parent: Any): ... 86 | def visit_try(self, node: Any, parent: Any): ... 87 | def visit_annassign(self, node: Any, parent: Any): ... 88 | def visit_with(self, node: Any, parent: Any): ... 89 | def visit_yieldfrom(self, node: Any, parent: Any): ... 90 | def visit_classdef(self, node: Any, parent: Any, newstyle: bool = ...): ... 91 | def visit_asyncfunctiondef(self, node: Any, parent: Any): ... 92 | def visit_asyncfor(self, node: Any, parent: Any): ... 93 | def visit_await(self, node: Any, parent: Any): ... 94 | def visit_asyncwith(self, node: Any, parent: Any): ... 95 | def visit_joinedstr(self, node: Any, parent: Any): ... 96 | def visit_formattedvalue(self, node: Any, parent: Any): ... 97 | TreeRebuilder = TreeRebuilder3 98 | -------------------------------------------------------------------------------- /stubs/astroid/scoped_nodes.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.scoped_nodes (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from astroid import mixins, node_classes 6 | from astroid.nodes import Decorators 7 | from typing import Any, Iterator, List, Optional 8 | 9 | BUILTINS: Any 10 | ITER_METHODS: Any 11 | 12 | def function_to_method(n: Any, klass: Any) -> Any: ... 13 | 14 | MANAGER: Any 15 | 16 | def builtin_lookup(name: Any) -> Any: ... 17 | 18 | class LocalsDictNodeNG(node_classes.LookupMixIn, node_classes.NodeNG): 19 | locals: Any = ... 20 | def qname(self) -> Any: ... 21 | def frame(self) -> Any: ... 22 | def scope(self) -> Any: ... 23 | def set_local(self, name: Any, stmt: Any) -> None: ... 24 | __setitem__: Any = ... 25 | def add_local_node(self, child_node: Any, name: Optional[Any] = ...) -> None: ... 26 | def __getitem__(self, item: Any) -> Any: ... 27 | def __iter__(self) -> Any: ... 28 | def keys(self) -> Any: ... 29 | def values(self) -> Any: ... 30 | def items(self) -> Any: ... 31 | def __contains__(self, name: Any) -> Any: ... 32 | 33 | class Module(LocalsDictNodeNG): 34 | lineno: int = ... 35 | file: Any = ... 36 | file_bytes: Any = ... 37 | file_encoding: Any = ... 38 | name: Any = ... 39 | pure_python: Any = ... 40 | package: Any = ... 41 | globals: Any = ... 42 | future_imports: Any = ... 43 | special_attributes: Any = ... 44 | scope_attrs: Any = ... 45 | doc: Any = ... 46 | path: Any = ... 47 | parent: Any = ... 48 | locals: Any = ... 49 | body: Any = ... 50 | def __init__(self, name: Any, doc: Any, file: Any=..., path: Optional[List[str]]=..., package: Any=..., parent: Any=..., pure_python: Any=...) -> None: ... 51 | def postinit(self, body: Optional[Any] = ...) -> None: ... 52 | def stream(self) -> Any: ... 53 | def block_range(self, lineno: Any) -> Any: ... 54 | def scope_lookup(self, node: Any, name: Any, offset: int = ...) -> Any: ... 55 | def pytype(self) -> Any: ... 56 | def display_type(self) -> Any: ... 57 | def getattr(self, name: Any, context: Optional[Any] = ..., ignore_locals: bool = ...) -> Any: ... 58 | def igetattr(self, name: Any, context: Optional[Any] = ...) -> Any: ... 59 | def fully_defined(self) -> Any: ... 60 | def statement(self) -> Any: ... 61 | def previous_sibling(self) -> None: ... 62 | def next_sibling(self) -> None: ... 63 | def absolute_import_activated(self) -> Any: ... 64 | def import_module(self, modname: Any, relative_only: bool = ..., level: Optional[Any] = ...) -> Any: ... 65 | def relative_to_absolute_name(self, modname: Any, level: Any) -> Any: ... 66 | def wildcard_import_names(self) -> Any: ... 67 | def public_names(self) -> Any: ... 68 | def bool_value(self) -> Any: ... 69 | def get_children(self) -> Iterator[node_classes.NodeNG]: ... 70 | 71 | class ComprehensionScope(LocalsDictNodeNG): 72 | def frame(self) -> Any: ... 73 | scope_lookup: Any = ... 74 | 75 | class GeneratorExp(ComprehensionScope): 76 | elt: Any = ... 77 | generators: Any = ... 78 | locals: Any = ... 79 | def __init__(self, lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 80 | def postinit(self, elt: Optional[Any] = ..., generators: Optional[Any] = ...) -> None: ... 81 | def bool_value(self) -> Any: ... 82 | def get_children(self) -> Iterator[node_classes.NodeNG]: ... 83 | 84 | class DictComp(ComprehensionScope): 85 | key: Any = ... 86 | value: Any = ... 87 | generators: Any = ... 88 | locals: Any = ... 89 | def __init__(self, lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 90 | def postinit(self, key: Optional[Any] = ..., value: Optional[Any] = ..., generators: Optional[Any] = ...) -> None: ... 91 | def bool_value(self) -> Any: ... 92 | def get_children(self) -> Iterator[node_classes.NodeNG]: ... 93 | 94 | class SetComp(ComprehensionScope): 95 | elt: Any = ... 96 | generators: Any = ... 97 | locals: Any = ... 98 | def __init__(self, lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 99 | def postinit(self, elt: Optional[Any] = ..., generators: Optional[Any] = ...) -> None: ... 100 | def bool_value(self) -> Any: ... 101 | def get_children(self) -> Iterator[node_classes.NodeNG]: ... 102 | 103 | class _ListComp(node_classes.NodeNG): 104 | elt: Any = ... 105 | generators: Any = ... 106 | def postinit(self, elt: Optional[Any] = ..., generators: Optional[Any] = ...) -> None: ... 107 | def bool_value(self) -> Any: ... 108 | def get_children(self) -> Iterator[node_classes.NodeNG]: ... 109 | 110 | class ListComp(_ListComp, ComprehensionScope): 111 | locals: Any = ... 112 | def __init__(self, lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 113 | 114 | class Lambda(mixins.FilterStmtsMixin, LocalsDictNodeNG): 115 | name: str = ... 116 | is_lambda: bool = ... 117 | def implicit_parameters(self) -> Any: ... 118 | @property 119 | def type(self) -> Any: ... 120 | locals: Any = ... 121 | args: Any = ... 122 | body: Any = ... 123 | def __init__(self, lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 124 | def postinit(self, args: Any, body: Any) -> None: ... 125 | def pytype(self) -> Any: ... 126 | def display_type(self) -> Any: ... 127 | def callable(self) -> Any: ... 128 | def argnames(self) -> Any: ... 129 | def infer_call_result(self, caller: Any, context: Optional[Any] = ...) -> Any: ... 130 | def scope_lookup(self, node: Any, name: Any, offset: int = ...) -> Any: ... 131 | def bool_value(self) -> Any: ... 132 | def get_children(self) -> Iterator[node_classes.NodeNG]: ... 133 | 134 | class FunctionDef(mixins.MultiLineBlockMixin, node_classes.Statement, Lambda): 135 | returns: Any = ... 136 | decorators: Any = ... 137 | special_attributes: Any = ... 138 | is_function: bool = ... 139 | type_annotation: Any = ... 140 | type_comment_args: Any = ... 141 | type_comment_returns: Any = ... 142 | name: Any = ... 143 | doc: Any = ... 144 | instance_attrs: Any = ... 145 | def __init__(self, name: Optional[Any] = ..., doc: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 146 | args: Any = ... 147 | body: Any = ... 148 | def postinit(self, args: Any, body: Any, decorators: Optional[Any] = ..., returns: Optional[Any] = ..., type_comment_returns: Optional[Any] = ..., type_comment_args: Optional[Any] = ...) -> None: ... 149 | def extra_decorators(self) -> Any: ... 150 | def type(self) -> Any: ... 151 | def fromlineno(self) -> int: ... 152 | def blockstart_tolineno(self) -> Any: ... 153 | def block_range(self, lineno: Any) -> Any: ... 154 | def getattr(self, name: Any, context: Optional[Any] = ...) -> Any: ... 155 | def igetattr(self, name: Any, context: Optional[Any] = ...) -> Any: ... 156 | def is_method(self) -> Any: ... 157 | def decoratornames(self) -> Any: ... 158 | def is_bound(self) -> Any: ... 159 | def is_abstract(self, pass_is_abstract: bool = ...) -> Any: ... 160 | def is_generator(self) -> Any: ... 161 | def infer_call_result(self, caller: Optional[Any] = ..., context: Optional[Any] = ...) -> None: ... 162 | def bool_value(self) -> Any: ... 163 | def get_children(self) -> Iterator[node_classes.NodeNG]: ... 164 | 165 | class AsyncFunctionDef(FunctionDef): ... 166 | 167 | def get_wrapping_class(node: Any) -> Any: ... 168 | 169 | class ClassDef(mixins.FilterStmtsMixin, LocalsDictNodeNG, node_classes.Statement): 170 | decorators: Optional[Decorators] = ... 171 | special_attributes: Any = ... 172 | hide: bool = ... 173 | type: Any = ... 174 | instance_attrs: Any = ... 175 | locals: Any = ... 176 | keywords: Any = ... 177 | bases: Any = ... 178 | body: Any = ... 179 | name: Any = ... 180 | doc: Any = ... 181 | def __init__(self, name: Optional[Any] = ..., doc: Optional[Any] = ..., lineno: Optional[Any] = ..., col_offset: Optional[Any] = ..., parent: Optional[Any] = ...) -> None: ... 182 | def implicit_parameters(self) -> Any: ... 183 | def implicit_locals(self) -> Any: ... 184 | def postinit(self, bases: Any, body: Any, decorators: Any, newstyle: Optional[Any] = ..., metaclass: Optional[Any] = ..., keywords: Optional[Any] = ...) -> None: ... 185 | newstyle: Any = ... 186 | def blockstart_tolineno(self) -> Any: ... 187 | def block_range(self, lineno: Any) -> Any: ... 188 | def pytype(self) -> Any: ... 189 | def display_type(self) -> Any: ... 190 | def callable(self) -> Any: ... 191 | def is_subtype_of(self, type_name: Any, context: Optional[Any] = ...) -> Any: ... 192 | def infer_call_result(self, caller: Any, context: Optional[Any] = ...) -> None: ... 193 | def scope_lookup(self, node: Any, name: Any, offset: int = ...) -> Any: ... 194 | @property 195 | def basenames(self) -> Any: ... 196 | def ancestors(self, recurs: bool = ..., context: Optional[Any] = ...) -> None: ... 197 | def local_attr_ancestors(self, name: Any, context: Optional[Any] = ...) -> None: ... 198 | def instance_attr_ancestors(self, name: Any, context: Optional[Any] = ...) -> None: ... 199 | def has_base(self, node: Any) -> Any: ... 200 | def local_attr(self, name: Any, context: Optional[Any] = ...) -> Any: ... 201 | def instance_attr(self, name: Any, context: Optional[Any] = ...) -> Any: ... 202 | def instantiate_class(self) -> Any: ... 203 | def getattr(self, name: Any, context: Optional[Any] = ..., class_context: bool = ...) -> Any: ... 204 | def igetattr(self, name: Any, context: Optional[Any] = ..., class_context: bool = ...) -> None: ... 205 | def has_dynamic_getattr(self, context: Optional[Any] = ...) -> Any: ... 206 | def getitem(self, index: Any, context: Optional[Any] = ...) -> Any: ... 207 | def methods(self) -> None: ... 208 | def mymethods(self) -> None: ... 209 | def implicit_metaclass(self) -> Any: ... 210 | def declared_metaclass(self, context: Optional[Any] = ...) -> Any: ... 211 | def metaclass(self, context: Optional[Any] = ...) -> Any: ... 212 | def has_metaclass_hack(self) -> Any: ... 213 | def slots(self) -> Any: ... 214 | def mro(self, context: Any=...) -> List[ClassDef]: ... 215 | def bool_value(self) -> Any: ... 216 | def get_children(self) -> Iterator[node_classes.NodeNG]: ... 217 | -------------------------------------------------------------------------------- /stubs/astroid/test_utils.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.test_utils (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any, Optional 6 | 7 | def require_version(minver: Optional[Any] = ..., maxver: Optional[Any] = ...): ... 8 | def get_name_node(start_from: Any, name: Any, index: int = ...): ... 9 | def enable_warning(warning: Any) -> None: ... 10 | -------------------------------------------------------------------------------- /stubs/astroid/transforms.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.transforms (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any, Optional 6 | 7 | class TransformVisitor: 8 | TRANSFORM_MAX_CACHE_SIZE: int = ... 9 | transforms: Any = ... 10 | def __init__(self) -> None: ... 11 | def register_transform(self, node_class: Any, transform: Any, predicate: Optional[Any] = ...) -> None: ... 12 | def unregister_transform(self, node_class: Any, transform: Any, predicate: Optional[Any] = ...) -> None: ... 13 | def visit(self, module: Any): ... 14 | -------------------------------------------------------------------------------- /stubs/astroid/util.pyi: -------------------------------------------------------------------------------- 1 | # Stubs for astroid.util (Python 3) 2 | # 3 | # NOTE: This dynamically typed stub was automatically generated by stubgen. 4 | 5 | from typing import Any 6 | 7 | def lazy_descriptor(obj: Any) -> Any: ... 8 | def lazy_import(module_name: Any) -> Any: ... 9 | 10 | class Uninferable: 11 | def __getattribute__(self, name: Any) -> Any: ... 12 | def __call__(self, *args: Any, **kwargs: Any) -> Any: ... 13 | def __bool__(self) -> bool: ... 14 | __nonzero__: Any = ... 15 | def accept(self, visitor: Any) -> Any: ... 16 | 17 | class BadOperationMessage: ... 18 | 19 | class BadUnaryOperationMessage(BadOperationMessage): 20 | operand: Any = ... 21 | op: Any = ... 22 | error: Any = ... 23 | def __init__(self, operand: Any, op: Any, error: Any) -> None: ... 24 | 25 | class BadBinaryOperationMessage(BadOperationMessage): 26 | left_type: Any = ... 27 | right_type: Any = ... 28 | op: Any = ... 29 | def __init__(self, left_type: Any, op: Any, right_type: Any) -> None: ... 30 | 31 | def proxy_alias(alias_name: Any, node_type: Any) -> Any: ... 32 | def limit_inference(iterator: Any, size: Any) -> None: ... 33 | --------------------------------------------------------------------------------