Open wheelereng opened 2 years ago
Will raise a PR at a later date, just noting here for visibility.
@wheelereng I wonder if you might be running a different mypy version or options, as the mypy build passes on CI: https://github.com/scrapinghub/price-parser/actions/runs/3409870069/jobs/5672160520 (this build is from a PR but it has no diff with master except for adding CI config). tox -e mypy
should reproduce what we run on CI.
@wheelereng I wonder if you might be running a different mypy version or options, as the mypy build passes on CI: https://github.com/scrapinghub/price-parser/actions/runs/3409870069/jobs/5672160520 (this build is from a PR but it has no diff with master except for adding CI config).
tox -e mypy
should reproduce what we run on CI.
This is an issue when mypy
is run with --no-explicit-reexport
, which is off by default (it is enabled with strict
) https://mypy.readthedocs.io/en/stable/config_file.html#confval-implicit_reexport
$ cat t.py
from price_parser import Price
$ mypy --no-implicit-reexport t.py
t.py:1: error: Module "price_parser" does not explicitly export attribute "Price" [attr-defined]
Found 1 error in 1 file (checked 1 source file)
When type checking with MyPy, an error is thrown when using
from price_parser import parse_price
, namely:I suspect this is due to the entities not being defined in
__all__