Optional dependencies
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 5.1k
- Forks
- 2.1k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 82
Beschreibung
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, Authlib has a module authlib.integrations.requests_client that works only if requests is 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:
- Add a field
optional-requirestoMETADATA.toml. stub_uploader checks that this has the same limitations asrequires. - In tests
optional-requiresis treated the same way thatrequiresis, i.e. the packages mentioned there are installed. stub_uploader adds this new field toproject.optional-dependenciesinpyproject.toml.
(Sidenote: Maybe we should rename requires to dependencies to match pyproject.toml.)
Linked PR:
- typeshed-internal/stub_uploader#203
- typeshed-internal/stub_uploader#208
- #15706
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der Untersuchung der Verarbeitung von METADATA.toml und der Validierung von stub_uploader. Sieh dir anschließend die Tests an, die Pakete aus requires installieren. Definiere das Verhalten der optional-requires-Metadaten und verifiziere, dass die relevanten Pakete für die Tests installiert sind, während du die referenzierten stub_uploader-PRs und #15706 auf bereits getroffene Entscheidungen prüfst.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- build-system, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100