cloudtools / cloudtools/troposphere

Upgrading `4.3.2` -> `4.4.1` causes mypy type checking to fail

Open
#2,186 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4.9k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

Hi,

to keep it short, when upgraded `4.3.2` -> `4.4.1`, mypy started throwing following errors

```
Skipping analyzing "troposphere": module is installed, but missing library stubs
or py.typed marker [import]
from troposphere import Ref
^
Skipping analyzing "troposphere.ecs": module is installed, but missing library
stubs or py.typed marker [import]
from troposphere.ecs import Environment as EnvironmentVariable
^
Skipping analyzing "troposphere": module is installed, but missing library stubs
or py.typed marker [import]
from troposphere import (
^
Skipping analyzing "troposphere.applicationautoscaling": module is installed,
but missing library stubs or py.typed marker [import]
from troposphere.applicationautoscaling import (
^

Skipping analyzing "troposphere.cloudwatch": module is installed, but missing
library stubs or py.typed marker [import]
from troposphere.cloudwatch import Alarm, MetricDimension
^

Skipping analyzing "troposphere.ec2": module is installed, but missing library
stubs or py.typed marker [import]
from troposphere.ec2 import SecurityGroup, SecurityGroupEgress, Securi...
^

Skipping analyzing "troposphere.ecs": module is installed, but missing library
stubs or py.typed marker [import]
from troposphere.ecs import (
^

Skipping analyzing "troposphere.efs": module is installed, but missing library
stubs or py.typed marker [import]
from troposphere.efs import (
^

Skipping analyzing "troposphere.elasticloadbalancingv2": module is installed,
but missing library stubs or py.typed marker [import]
from troposphere.elasticloadbalancingv2 import (
^
```

mypy config is
```toml

[tool.mypy]
python_version = "3.11"
strict = true
pretty = true
show_error_codes = true
warn_unused_ignores = false
plugins = ["pydantic.mypy"]
```

Pydantic version is `"==1.10.12"`
Mypy version is `mypy = "1.5.1"`

Please let me know if more information is needed.

Contributor guide

Open the contributing guide

Research direction

Start with the reported mypy configuration and reproduce the upgrade from 4.3.2 to 4.4.1 using Python 3.11, mypy 1.5.1, and Pydantic 1.10.12. No source file or test is named; done means the upgrade no longer produces missing stubs or py.typed marker errors for troposphere imports.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.