Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: type hint config so they are available to mypy #52

Merged
merged 1 commit into from
Aug 22, 2020
Merged

fix: type hint config so they are available to mypy #52

merged 1 commit into from
Aug 22, 2020

Conversation

sbdchd
Copy link
Contributor

@sbdchd sbdchd commented Aug 14, 2020

@sanzoghenzo correctly pointed out that a py.typed file alone wasn't
enough to get the typing working, we also need to move inflection into
a package.

I tested this by running ./.venv/bin/python setup.py sdist and installing the generated .tar.gz file into a blank project.
First attempt without the setup.py changes didn't work, but moving to a package did.

example error:

main.py:3:21: error: Argument 1 to "camelize" has incompatible type "bool"; expected
"str"
    inflection.camelize(False)
                        ^
Found 1 error in 1 file (checked 1 source file)

fixes: #49

rel: https://www.python.org/dev/peps/pep-0561/#packaging-type-information

@sanzoghenzo correctly pointed out that a `py.typed` file alone wasn't
enough to get the typing working, we also need to move inflection into
a package.

fixes: #49

rel: https://www.python.org/dev/peps/pep-0561/#packaging-type-information
Copy link
Owner

@jpvanhal jpvanhal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@jpvanhal jpvanhal merged commit 5f22a6f into jpvanhal:master Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type hints not working (due to missing py.typed file?)
2 participants