A public way to add feature definitions to FeatureSet

Aperta
#842 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
56/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
api

Direzione di ricerca

Start by reading FeatureSet, especially find_feature() and feature_tree(), then inspect caldav_server_tester/future_features.py to see how definitions are currently added. Done means a public register_features(definitions) method adds missing definitions, keeps caldav's definitions when names overlap, clears the relevant caches, and returns the names added.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Disclaimer: AI-generated text below the line, generated by Claude Opus 5.5, from the prompt(s):

The problem is that the compatibility tree cannot be edited without also releasing the caldav library. However, this is big friction, perhaps we should find some workaround in 1.7.0. Like, having a FUTURE_FEATURES dict that contains not-yet-released changes in the caldav library, and then patch up caldav.compatibility_hints.FEATURES |= FUTURE_FEATURES, could that work out?


A new probe in caldav-server-tester needs a feature definition in FeatureSet.FEATURES, and that can only change with a caldav release. To get past this, the tester now carries the definitions caldav has not released yet (FUTURE_FEATURES in caldav_server_tester/future_features.py) and adds them to FeatureSet.FEATURES when it is imported.

That works, but it depends on caldav internals: find_feature() caches subfeatures inside the definitions and feature_tree() caches _feature_tree, so the tester has to clear both, or a parent looked up before the patch never lists its new child.

Suggestion: a class method such as FeatureSet.register_features(definitions: dict) -> list[str] that adds the definitions caldav lacks, keeps caldav's own where both define a feature, clears the caches, and returns the names it added. The tester would then call that instead of patching the class.

Lingua principale
Python
Stelle
412
Fork
113
Merge medio
9h 21m
PR unite (30g)
77

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python-caldav/caldav

Tutte le issue di python-caldav/caldav

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.