cloudtools / cloudtools/troposphere
PyCharm autocompletion for properties
- Dominant language
- Python
- Stars
- 4.9k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
Due to the fact that the classes have dynamically generated fields for the AWS resource properties, IDEs like PyCharm doesn't suggest those fields during autocompletion.
For example:
```Python
from troposphere import Template, apigateway
t = Template()
apiResource = apigateway.Resource("contactcloud")
apiResource.ParentId #<-- won't be suggested by autocompletion!
```
This could be remedied in two ways:
### 1. Add type hints to the beginning of classes, e.g.:
```Python
class Resource(AWSObject):
ParentId: basestring # Python 3 type hints for fields
PathPart: basestring
RestApiId: basestring
resource_type = "AWS::ApiGateway::Resource"
props = {
"ParentId": (basestring, True),
"PathPart": (basestring, True),
"RestApiId": (basestring, True)
}
```
### 2. Generate stub files
This is outlined by [PEP 484#stub-files](https://www.python.org/dev/peps/pep-0484/#stub-files)
Contributor guide
Assessment
This issue has not been assessed yet.