-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Optional dependencies #15549
Copy link
Copy link
Open
Labels
project: infrastructuretypeshed build, test, documentation, or distribution relatedtypeshed build, test, documentation, or distribution related
Metadata
Metadata
Assignees
Labels
project: infrastructuretypeshed build, test, documentation, or distribution relatedtypeshed build, test, documentation, or distribution related
Fields
Give feedbackNo fields configured for issues without a type.
See #15548 for an example of this problem.
Currently, we don't support optional dependencies in typeshed. Say a third-party package has some additional functionality if another third-party package is installed. For example,
Authlibhas a moduleauthlib.integrations.requests_clientthat works only ifrequestsis also installed. This leads to the awkward situation that our stubs for that module have many comments of the form "Inherits from requests.Session".I suggest that we should add support for optional dependencies. Here's an idea:
optional-requirestoMETADATA.toml. stub_uploader checks that this has the same limitations asrequires.optional-requiresis treated the same way thatrequiresis, i.e. the packages mentioned there are installed.project.optional-dependenciesinpyproject.toml.(Sidenote: Maybe we should rename
requirestodependenciesto matchpyproject.toml.)