Marks the httpx_auth package as typed so typecheckers can use the annotations, with the Typing :: Typed PyPI classifier as a bonus ^^
How to test
In a new virtualenv, run pip install mypy git+https://github.com/nymous/httpx_auth.git@indicate-typed-package.
Create the following main.py, then run mypy main.py
from httpx_auth import OAuth2AuthorizationCode
oauth_class = OAuth2AuthorizationCode('https://www.authorization.url', 'https://www.token.url')
reveal_type(oauth_class)
OAuth2AuthorizationCode(123) # This will fail mypy
Result before:
main.py:1: error: Skipping analyzing "httpx_auth": module is installed, but missing library stubs or py.typed marker
main.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
main.py:5: note: Revealed type is "Any"
Found 1 error in 1 file (checked 1 source file)
Result after:
main.py:5: note: Revealed type is "httpx_auth.authentication.OAuth2AuthorizationCode"
main.py:7: error: Missing positional argument "token_url" in call to "OAuth2AuthorizationCode"
main.py:7: error: Argument 1 to "OAuth2AuthorizationCode" has incompatible type "int"; expected "str"
Found 2 errors in 1 file (checked 1 source file)
Note: this will fail if mypy is run with the --strict flag (and more precisely --no-implicit-reexport), another PR like Colin-b/pytest_httpx#57 will come later.
Fixes #43 (with inspiration from Colin-b/pytest_httpx#44 for the setup.pypackage_data and the changelog entry)
Marks the
httpx_auth
package as typed so typecheckers can use the annotations, with theTyping :: Typed
PyPI classifier as a bonus ^^How to test
In a new virtualenv, run
pip install mypy git+https://github.com/nymous/httpx_auth.git@indicate-typed-package
. Create the followingmain.py
, then runmypy main.py
Result before:
Result after:
Note: this will fail if mypy is run with the
--strict
flag (and more precisely--no-implicit-reexport
), another PR like Colin-b/pytest_httpx#57 will come later.Fixes #43 (with inspiration from Colin-b/pytest_httpx#44 for the
setup.py
package_data
and the changelog entry)