GithubHelp home page GithubHelp logo

Comments (3)

Colin-b avatar Colin-b commented on September 21, 2024

Hello @nymous ,

Sure go ahead with the PR, it will be a nice touch :)

Thanks

from httpx_auth.

nymous avatar nymous commented on September 21, 2024

Just to see how well it would work, I added the py.typed file in the virtualenv of my application. When running mypy (in strict mode) I stumbled upon the following issue:

Module "httpx_auth" does not explicitly export attribute "OAuth2ClientCredentials"; implicit reexport disabled

This error also happens when using pyright with default configuration, and is because of this

This flag changes the behavior to not re-export unless the item is imported using from-as or is included in __all__.

(seen in this mypy docs).

To fix this would require to define in this __init__.py a __all__ with everything you want to export, or to use the form from httpx_auth.aws import AWS4Auth as AWS4Auth for every import.
Not doing this would require end users to add this configuration to mypy (I haven't look at how to do it with pyright):

[mypy-,httpx_auth.*]
no_implicit_reexport = False

How do you want to approach this? Do you prefer the code to stay untouched and document the configuration? Do you want to use the from ... import ... as ... form?


Also, before adding the py.typed file I wanted to check if mypy was happy with the code, and... mypy found 30 issues, pyright 26 😅 Would you be interested in a contribution to improve the internal types?
Should I start with the simple py.typed + PyPI classifier PR, then another for the types, with maybe a release after both?

from httpx_auth.

Colin-b avatar Colin-b commented on September 21, 2024

Every contribution is more than welcome :)
Indeed I would rather have PR as small as possible, I don't mind multiple PRs at all :)

So a first one with the py.typed and the classifier, then a second one with the all as in this PR on another project ?

And If you still feel like it, feel free to address the issues mypy and pyright found in another PR after that :D

Thanks again

from httpx_auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.