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

Add typing #25

Open
merwok opened this issue Oct 4, 2018 · 11 comments
Open

Add typing #25

merwok opened this issue Oct 4, 2018 · 11 comments

Comments

@merwok
Copy link
Contributor

merwok commented Oct 4, 2018

Add type declarations (I think Python 3 native syntax, and drop 2.7 support)

Run mypy from tox

Run mypy in CI

@merwok
Copy link
Contributor Author

merwok commented Oct 4, 2018

@just1602 intéressé?

@just1602 just1602 self-assigned this Oct 4, 2018
@just1602
Copy link

We should think about contributing typing stub file for boto3 and dotenv library.

@merwok
Copy link
Contributor Author

merwok commented Oct 20, 2018

Good idea! The first goal here was to make sure the store and backend classes cooperate in the right way, in complement to integration tests. Contributing a stub file to django-dotenv could be interesting!

@merwok
Copy link
Contributor Author

merwok commented Oct 24, 2018

@just1602 Any feedback on mypy vs pyre?

@just1602
Copy link

I didn't have the time to test yesterday. I'll have to test with ABC to see if it works with mypy. Otherwise we'll have to stay with pyre-check or open issue to mypy repo.

@merwok
Copy link
Contributor Author

merwok commented Oct 24, 2018

I meant: I don’t know why your PR uses pyre and not mypy, can you give details?

(independently of my inheritance/interface review)

@just1602
Copy link

@merwok because pyre handle the inheritance correctly and not mypy. Mypy give me error that the parameter self is missing when I call a method of an object.

@merwok
Copy link
Contributor Author

merwok commented Oct 24, 2018

@merwok
Copy link
Contributor Author

merwok commented Oct 24, 2018

This is the error message:

configstore/store.py:23: error: Too few arguments for "get_setting" of "Backend"
configstore/store.py:23: error: Argument 1 to "get_setting" of "Backend" has incompatible type "str"; expected "Backend"

@just1602
Copy link

But pyre handle this gracefully. Maybe we should open an issue to see what's going on.

@merwok
Copy link
Contributor Author

merwok commented Oct 24, 2018

Validates if I use Tuple[Backend] without Type (after quickly checking the doc for Type that seems to be useful for more complicated setups).

@just1602 just1602 removed their assignment Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants