nbdev with fasthtml
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 30/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- jupyter, jupyter-notebook, python
- Ambito
- developer-experience, documentation
Direzione di ricerca
Inizia riproducendo il comportamento segnalato con component.py e il comando uv run python -m hao.component, quindi confronta la risoluzione dei percorsi in Jupyter, nel pacchetto esportato e in nbdev_docs. Esamina l’esempio static-file e il comportamento di importazione di nbdev_docs; il lavoro è completato quando il workflow fasthtml supportato e le regole dei percorsi static-file sono documentati, oppure quando il divario di compatibilità è chiaramente identificato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Should there be a way to use nbdev to develop a package that uses fasthtml?
I'm trying to port the fasthtml 3d-component example to run in nbdev to understand the framework but getting stuck on paths and importers
This is related to my bigger issue which is I can't figure out how to reference static files so that they resolve in Jupyter, exported python package and docs.
I can resolve Jupyter and exported python package, using the following to use .parent in the exported python file and .cwd in Jupyter but can't find any docs on how to rewrite file_path to support nbdev_docs (which crashes not being able to resolve this file).
try:
file_path = Path(__file__).parent/f"../nbs/static/data/csv/Mandarin vocab lists - hsk{config['hsk_level']}.csv"
except NameError:
file_path = Path.cwd()/f"static/data/csv/Mandarin vocab lists - hsk{config['hsk_level']}.csv"
vocab = pd.read_csv(file_path)
I'm suspecting that nbdev & fasthtml (or any ASGI service) aren't compatible because I can happily run exported files in my editable package
python -m hao.flashcards
but the ported 3d-components one (renamed https://github.com/AnswerDotAI/fasthtml-example/blob/main/3d-component/main.py to component.py) will start and then complain about the module as below
$ uv run python -m hao.component
Link: http://localhost:5001
INFO: Will watch for changes in these directories: ['/home/XXX/src/hao']
INFO: Uvicorn running on http://0.0.0.0:5001 (Press CTRL+C to quit)
INFO: Started reloader process [10395] using WatchFiles
ERROR: Error loading ASGI app. Could not import module "component".
Any advice?
- Lingua principale
- Jupyter Notebook
- Stelle
- 5.3k
- Fork
- 514
- Merge medio
- 2g 30m
- PR unite (30g)
- 8
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di AnswerDotAI/nbdev
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
AnswerDotAI/nbdev#1596 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
AnswerDotAI/nbdev#1587 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
AnswerDotAI/nbdev#1584 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
AnswerDotAI/nbdev#1583 · 1 commento · 1 reazione ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
AnswerDotAI/nbdev#1581 ·
Tutte le issue di AnswerDotAI/nbdev
Issue simili
-
category:port-update
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Use issue templatesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ActivityWatch/activitywatch#1464 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: The ckg tool drops the return type of every decorated Python method in class search resultsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
bytedance/trae-agent#483 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
flathub/flathub#10377 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
kriasoft/oauth-callback#57 ·
I maintainer di solito rispondono entro 1 giorno