{"task": {"agent_timeout": 3000, "task": "python__mypy-10937", "verifier_timeout": 6000, "instruction": "Cache causes mypy to fail every 2nd run for module importing from aws_cdk\n**Bug Report**\n\nWhen `mypy` is run multiple times on a Python module containing `from aws_cdk import core` it will fail every 2nd time due to the error \"Skipping analyzing 'aws_cdk': found module but no type hints or library stubs\".\n\nDisabling the mypy cache with `--no-incremental` will result in `mypy` passing every time.\n\n**To Reproduce**\n\n1. Install `mypy` and `aws-cdk.core`.\n2. Create a Python module with `from aws_cdk import core`.\n3. Run `mypy` on the module and it will pass.\n4. Run `mypy` on the module again and it will fail. Subsequent runs will cycle between passing and failing.\n\n```\n$ python3.8 -m venv .venv && source .venv/bin/activate\n(.venv) $ pip install mypy==0.790 aws-cdk.core==1.80.0\n(.venv) $ echo 'from aws_cdk import core' > repro.py\n(.venv) $ mypy repro.py\nSuccess: no issues found in 1 source file\n(.venv) $ mypy repro.py\nrepro.py:1: error: Skipping analyzing 'aws_cdk': found module but no type hints or library stubs\nrepro.py:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports\nFound 1 error in 1 file (checked 1 source file)\n(.venv) $ mypy repro.py\nSuccess: no issues found in 1 source file\n(.venv) $ mypy repro.py\nrepro.py:1: error: Skipping analyzing 'aws_cdk': found module but no type hints or library stubs\nrepro.py:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports\nFound 1 error in 1 file (checked 1 source file)\n```\n\n**Expected Behavior**\n\nRunning `mypy` on a module containing only `from aws_cdk import core` should always pass.\n\n**Actual Behavior**\n\nEvery second time `mypy` is run on the module it will report an error.\n\n**Your Environment**\n\n- Mypy version used: 0.790\n- Mypy command-line flags: none\n- Mypy configuration options from `mypy.ini` (and other config files): none\n- Python version used: 3.8.2\n- Operating system and version: macOS\n- `aws-cdk.core` version used: 1.80.0\n\nThe problem may be related to how the package that is installed is `aws-cdk.core` but the namespace being imported from is `aws_cdk`. A workaround is to change:\n\n```python\nfrom aws_cdk import core\n```\n\nto:\n\n```python\nimport aws_cdk.core as core\n```\n\nThe first form is what is generated by [the `cdk` tool](https://docs.aws.amazon.com/cdk/latest/guide/hello_world.html#hello_world_tutorial_create_app) and used in the cdk [example code](https://github.com/aws-samples/aws-cdk-examples/tree/master/python).\n", "memory": "8192m", "runnable": false, "difficulty": "hard", "language": "", "cpus": 1, "instruction_truncated": false, "category": "debugging", "compose": false, "has_solution": true, "oracle": null, "docker_image": "", "taskset": "swegym", "tags": ["debugging", "swe-bench"]}, "runs": []}