Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

argv parsing in 5.x to pass a set, how to

Ouverte
#640 2 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
20/100
Type d'issue
Bug
Clarté
À clarifier
Activité
À l'abandon
Stack technique
python
Domaine
cli

Piste de recherche

Commencez par reproduire la commande Voila indiquée et examinez la gestion par argparse de TagRemovePreprocessor.remove_cell_tags. Déterminez comment les options à valeur d’ensemble sont analysées dans le comportement de 5.x, puis vérifiez que l’exécution se termine correctement lorsque la commande accepte l’option sans lever TraitError ; l’issue ne mentionne aucun fichier ni test du dépôt.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

After upgrading to 5.x I can no longer use the command I once was with voila - after having read through other issues and the docs I see the parsing has changed.
https://github.com/voila-dashboards/voila/issues/813

The difficulty I am running into - is I don't see how to pass a set as an option?

For example, I used to use:

voila --no-browser --ExecutePreprocessor.timeout=300 --theme=dark --TagRemovePreprocessor.remove_cell_tags='{"hide"}'

but I get the below error when opening notebooks with voila:

Jan 21 16:56:38 abc-123-086427 voila[2580]:   File "/home/ubuntu/miniconda3/envs/data_analysis_lab/lib/python3.8/site-packages/traitlets/traitlets.py", line 610, in _validate
Jan 21 16:56:38 abc-123-086427 voila[2580]:     value = self.validate(obj, value)
Jan 21 16:56:38 abc-123-086427 voila[2580]:   File "/home/ubuntu/miniconda3/envs/data_analysis_lab/lib/python3.8/site-packages/traitlets/traitlets.py", line 2496, in validate
Jan 21 16:56:38 abc-123-086427 voila[2580]:     value = super(Container, self).validate(obj, value)
Jan 21 16:56:38 abc-123-086427 voila[2580]:   File "/home/ubuntu/miniconda3/envs/data_analysis_lab/lib/python3.8/site-packages/traitlets/traitlets.py", line 1845, in validate
Jan 21 16:56:38 abc-123-086427 voila[2580]:     self.error(obj, value)
Jan 21 16:56:38 abc-123-086427 voila[2580]:   File "/home/ubuntu/miniconda3/envs/data_analysis_lab/lib/python3.8/site-packages/traitlets/traitlets.py", line 690, in error
Jan 21 16:56:38 abc-123-086427 voila[2580]:     raise TraitError(e)
Jan 21 16:56:38 abc-123-086427 voila[2580]: traitlets.traitlets.TraitError: The 'remove_cell_tags' trait of a TagRemovePreprocessor instance expected a set, not the str '{"hide"}'.
Jan 21 16:56:38 abc-123-086427 voila[2580]: ERROR:tornado.access:500 GET /voila/render/beta/BSR/Computational_Thinking/what_is_an_algorithm.ipynb (::1) 204.10ms

So for --TagRemovePreprocessor.remove_cell_tags the error is now saying it is expecting a set and not a str

I have tried many combinations such as:

voila --no-browser --ExecutePreprocessor.timeout=300 --theme=dark --TagRemovePreprocessor.remove_cell_tags=hide

Searching through cli options in argparse I don't see a way to pass a set from the cli that TagRemovePreprocessor.remove_cell_tags is expecting.

Langage dominant
Python
Étoiles
653
Forks
221
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de ipython/traitlets

Toutes les issues de ipython/traitlets

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.