nbdev with fasthtml
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 30/100
- Issue-Typ
- Feature
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- jupyter, jupyter-notebook, python
- Bereich
- developer-experience, documentation
Rechercherichtung
Beginne damit, das gemeldete Verhalten mit component.py und dem Befehl uv run python -m hao.component zu reproduzieren, und vergleiche anschließend die Pfadauflösung in Jupyter, im exportierten Paket und in nbdev_docs. Überprüfe das static-file-Beispiel und das Importverhalten von nbdev_docs; als erledigt gilt die Aufgabe, wenn der unterstützte fasthtml-Arbeitsablauf und die Regeln für static-file-Pfade dokumentiert sind oder die Kompatibilitätslücke eindeutig identifiziert wurde.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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?
- Vorherrschende Sprache
- Jupyter Notebook
- Sterne
- 5.3k
- Forks
- 514
- Ø Merge
- 2 T. 30 Min.
- Gemergte PRs (30 T.)
- 8
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus AnswerDotAI/nbdev
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
AnswerDotAI/nbdev#1596 · 1 Kommentar ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
AnswerDotAI/nbdev#1587 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
AnswerDotAI/nbdev#1584 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
AnswerDotAI/nbdev#1583 · 1 Kommentar · 1 Reaktion ·
-
bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 52/100
AnswerDotAI/nbdev#1581 ·
Alle Issues in AnswerDotAI/nbdev
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
ScoopInstaller/Extras#18835 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
parse-community/parse-server#10699 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent/quality hive/hosted-available-lke648397-260827-5n31 quality testing
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug component:molsysmt
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100