stac-utils / stactools

Command line utility and Python library for STAC
https://stactools.readthedocs.io/
Other
104 stars 28 forks source link

py.typed files missing from distribution package #444

Closed chuckwondo closed 1 year ago

chuckwondo commented 1 year ago

Describe the bug

The py.typed files in the stactools.core, stactools.cli, and stactools.testing packages are not packaged in the published distribution, thus mypy cannot resolve types for stactools when used as a dependency.

To reproduce

Steps to reproduce the behavior:

python -m venv .venv
source .venv/bin/activate
python -m pip install stactools mypy
mypy -c "from stactools.core.io.xml import XmlElement"

The mypy command above outputs the following:

<string>:1: error: Skipping analyzing "stactools.core.io.xml": module is installed, but missing library stubs or py.typed marker  [import]
<string>:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)

Expected behavior

The output from mypy should instead be:

Success: no issues found in 1 source file

I can achieve this expected behavior by simply creating the missing py.typed file relevant to this example:

touch .venv/lib/python3.10/site-packages/stactools/core/py.typed

Afterwards, the above mypy command outputs the expected "success" message.