Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop typed-ast as is no longer maintained/used #373

Merged
merged 1 commit into from Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 0 additions & 24 deletions README.md
Expand Up @@ -111,27 +111,3 @@ creates a circular import problem. The solution to this is the following:
2. Use forward references in the type annotations (e.g. `def methodname(self, param1: 'othermodule.OtherClass'):`)

On Python 3.7, you can even use `from __future__ import annotations` and remove the quotes.

## Using type hint comments

If you\'re documenting code that needs to stay compatible with Python 2.7, you cannot use regular type annotations.
Instead, you must either be using Python 3.8 or later or have [typed_ast](https://pypi.org/project/typed-ast/)
installed. The package extras `type_comments` will pull in the appropriate dependencies automatically. Then you can add
type hint comments in the following manner:

```python
def myfunction(arg1, arg2):
# type: (int, str) -> int
return 42
```

or alternatively:

```python
def myfunction(
arg1, # type: int
arg2, # type: str
):
# type: (...) -> int
return 42
```
3 changes: 0 additions & 3 deletions pyproject.toml
Expand Up @@ -56,9 +56,6 @@ optional-dependencies.testing = [
"sphobjinv>=2.3.1",
"typing-extensions>=4.6.3",
]
optional-dependencies.type-comment = [
'typed-ast>=1.5.4; python_version < "3.8"',
]
urls.Changelog = "https://github.com/tox-dev/sphinx-autodoc-typehints/blob/main/CHANGELOG.md"
urls.Homepage = "https://github.com/tox-dev/sphinx-autodoc-typehints"
urls.Source = "https://github.com/tox-dev/sphinx-autodoc-typehints"
Expand Down