HBNetwork / python-decouple

Strict separation of config from code.
MIT License
2.79k stars 192 forks source link

Add support for type stubs #122

Closed yoav-orca closed 3 years ago

yoav-orca commented 3 years ago

Typing is becoming fairly popular in the python world, would you be open to accepting a PR adding type annotations?

henriquebastos commented 3 years ago

No. Tks

colidyre commented 1 year ago

FWIW: So I think to make the package PEP-561 compliant someone else have to write a stub package as mentioned for example at https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-library-stubs-or-py-typed-marker.

If someone else is getting an error like this:

$ poetry run mypy --strict application.py app tests
app/settings.py:1: error: Skipping analyzing "decouple": module is installed, but missing library stubs or py.typed marker  [import]
app/settings.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

and has no time to write a stub package like me, you can add that code to ignore the "missing imports" failure to your pyproject.toml for this package:

[[tool.mypy.overrides]]
module = "decouple"
ignore_missing_imports = true
shmulvad commented 9 months ago

The missing type hints also started to annoy me. If you're interested, I created a fork of this repo that has added type hints: https://github.com/shmulvad/python-decouple-typed

It can be installed with pip install python-decouple-typed

gotofritz commented 4 months ago

Thanks @shmulvad - I don't get why @henriquebastos is against type definitions (why?!??), and the way he just closes or rejects PRs without even explaining why is rude and irritating.