madzak / python-json-logger

Json Formatter for the standard python logger
BSD 2-Clause "Simplified" License
1.7k stars 231 forks source link

Add `py.typed` to package #156

Closed akshayphdk closed 1 year ago

akshayphdk commented 1 year ago

I'm trying to use python-json-logger in my project, but mypy is surfacing this error:

error: Skipping analyzing "pythonjsonlogger": module is installed, but missing library stubs or py.typed marker
note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

I believe there is an open issue related to this: https://github.com/madzak/python-json-logger/issues/118 My guess why this continues to happen even though py.typed exists in the repo is because it isn't added to the package.

bringhurst commented 1 year ago

Just fyi, this marker was intentionally excluded in https://github.com/madzak/python-json-logger/pull/129 since typing was incomplete at the time.

Before this is merged in, it would probably be a good idea to set disallow_untyped_defs = true in setup.cfg and fix anything it complains about.

madzak commented 1 year ago

Thanks, will evaluate bringhursts note after I'm done merging pull requests.

mike-oakley commented 1 year ago

@madzak any chance you could cut a release which includes this fix? 🙏🏼