Core: Add py.typed, Remove docs from source dist #12232
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
In order to actually use the type-hints, we need to add a
py.typed
-file - see the mypy-docs for more info. We don't have to explicitly configure anything for this file to be part of both the wheel and source dist - we're already including almost all files by default.I've added types to
localstack.state.core.py
just because I needed it upstream. There is still a lot of code untyped, so there is an argument that we should not includepy.typed
(i.e., mark this package ready for type hints) until we know for sure all type-hints are correct. This is a bit of an alternative chicken-and-egg problem - we don't have all the types yet, but we also don't advertise the package as being typed, so there is no rush to work on this. I'm in favour of includingpy.typed
regardless, and use it as a stick - things may break, types may be wrong, but it forces us to improve it.Related: while building the source dist I also realized that it currently contains a lot of files/folders that we (IMHO) should not include, like the docs and CI workflows. Excluding these reduces the source dist size from 4.3MB to 3.4MB.