humps icon indicating copy to clipboard operation
humps copied to clipboard

Add __all__ to __init__

Open hasier opened this issue 2 years ago • 9 comments

Status

READY

Description

mypy complains that the symbols don't exist, it says error: Module has no attribute "camelize"; maybe "decamelize"?. Explicitly exposing all the functions in __all__ correctly signals that all of them are available.

Also, reordered the imports a bit to follow the same pattern for all (-ize function 1, de-ize function 1, ..., is_ function 1, ...).

Impacted Areas in Application

List general components of the application that this PR will affect:

  • Typing

hasier avatar Jul 04 '22 16:07 hasier

@nficano @ificiana any chance you can take a look into this? 🙂

hasier avatar Jul 19 '22 14:07 hasier

@hasier can you provide something to reproduce the bug?

ificiana avatar Jul 22 '22 09:07 ificiana

@hasier can you provide something to reproduce the bug?

Hmm I'm having trouble reproducing this in a clean environment now 🤔 Let me test it a bit more and I'll come back to you.

hasier avatar Jul 22 '22 09:07 hasier

Got it, tiny project setup to reproduce.

Dependencies:

  • Python 3.10
  • pyhumps == 3.7.2
  • mypy == 0.971

main.py

import humps

if __name__ == "__main__":
    print(humps.camelize("some_variable"))
$ poetry run mypy main.py --strict
test.py:4: error: Module has no attribute "camelize"; maybe "decamelize"?

hasier avatar Jul 22 '22 09:07 hasier

alright, I've confirmed the bug, thanks for your contribution! I've approved the changes

ificiana avatar Jul 22 '22 09:07 ificiana

@nficano any chance we can get this merged and published in a new release? It'd be great to get rid of the mypy error 🙂

hasier avatar Aug 10 '22 10:08 hasier

This was wrongly addressed in PR #277, which is released, and there's a fix for it in PR #281

sk- avatar Aug 30 '22 22:08 sk-

@nficano @sk- are you planning on merging either this or https://github.com/nficano/humps/pull/281 then? 🙏

hasier avatar Sep 14 '22 08:09 hasier

@hasier I'm not the maintainer of the project, so I cannot merge either of the PRs.

@nficano could we settle in either #275 or #281 ?

sk- avatar Sep 14 '22 12:09 sk-

yes, sorry on it 👍

nficano avatar Oct 20 '22 18:10 nficano