aws / aws/chalice

Remove app.pyi file

Open
#1,802 0 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
11.1k
Forks
1k
Avg merge
1d 22h
Merged PRs (30d)
2

Description

This tracking issues proposes removing the [app.pyi](https://github.com/aws/chalice/blob/master/chalice/app.pyi) from Chalice as we no longer need it.

This file was originally added because we had to support Python 2.7. This meant not only could we not use annotations for type info, but we couldn't import `typing` because we wanted to avoid the extra runtime cost of having that module available for python2.

This `app.pyi` file has always been out of sync. We made a best effort to keep things updated, but this was also before tools such as `mypy.stubtest` were around to help us verify they match. There have been several PRs from contributors to try and bring things into sync, but this will always be a moving target, and even checking on this now, there's still inconsistencies between the two files.

Now that we no longer support Python 2.7, I'd like to drop the app.pyi file and add the type information directly into app.py. We'll need to make sure we only use type info from Python 3.6, but this should fix the inconsistencies we have, and make writing Chalice apps easier as we see more people using PyCharm, VSCode, pyright, mypy, etc.

Contributor guide

Open the contributing guide

Research direction

Start by comparing chalice/app.pyi with chalice/app.py and identify the type information that must move into app.py. Remove app.pyi, use only Python 3.6-compatible type information, and verify that the application typing remains consistent for tools such as PyCharm, VSCode, pyright, and mypy.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.