nbdev with fasthtml
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 30/100
- Type d'issue
- Fonctionnalité
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- jupyter, jupyter-notebook, python
- Domaine
- developer-experience, documentation
Piste de recherche
Commencez par reproduire le comportement signalé avec component.py et la commande uv run python -m hao.component, puis comparez la résolution des chemins dans Jupyter, le package exporté et nbdev_docs. Examinez l’exemple static-file et le comportement d’importation de nbdev_docs ; le travail est considéré comme terminé lorsque le workflow fasthtml pris en charge et les règles de chemin static-file sont documentés, ou que l’écart de compatibilité est clairement identifié.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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?
- Langage dominant
- Jupyter Notebook
- Étoiles
- 5.3k
- Forks
- 514
- Merge moyen
- 2 j 30 min
- PR mergées (30 j)
- 8
Préparer son environnement
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de AnswerDotAI/nbdev
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
AnswerDotAI/nbdev#1596 · 1 commentaire ·
-
`great-docs` by Posit Is here!Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
AnswerDotAI/nbdev#1587 ·
-
Interested in Windows support?Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
AnswerDotAI/nbdev#1584 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
AnswerDotAI/nbdev#1583 · 1 commentaire · 1 réaction ·
-
bug
Difficulté 3/5 1-2 jours Accessibilité débutants 52/100
AnswerDotAI/nbdev#1581 ·
Toutes les issues de AnswerDotAI/nbdev
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Detect Deno tasks from deno.jsonOuvertedetectors enhancement good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
SM260845/readme-gen#1 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
ehmpathy/rhachet-roles-bhuild#407 ·
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
codymikol/multiverse.nvim#330 ·
Les mainteneurs répondent en général sous 8 jours
-
bug cli dx
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
videojs/v10#3001 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour