Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow specifying multiple extensions on the command-line with traitlets 5 #12543

Merged
merged 1 commit into from Sep 7, 2020

Conversation

minrk
Copy link
Member

@minrk minrk commented Sep 4, 2020

In traitlets 4, only one extension could be loaded with --ext, so:

ipython --ext Cython --ext autoreload

would only actually load autoreload, the last occurrence, silently ignoring Cython. With traitlets 5, this silent failure to activate two extensions has turned into an error (see ipython/traitlets#614).

But this syntax Just Works™ for List traits with traitlets 5, so this PR adds a new extra_extensions plural trait that behaves the same as the existing one, while adding support for specifying multiple extensions if the alias is given multiple times.

For backwards-compatibility, instead of updating in-place, add a new extra_extensions list and point the --ext alias to the new list on traitlets 5 and leave it on the existing extra_extension on traitlets 4.

closes #12541
closes ipython/traitlets#614

IPython/core/shellapp.py Outdated Show resolved Hide resolved
for backward-compatibility, add new `extra_extensions` list

Use new list only with traitlets 5, keep old singleton behavior with traitlets 4
).tag(config=True)

extra_extensions = List(
DottedObjectName(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has, I forgot we could do that.

@Carreau Carreau added this to the 7.19 milestone Sep 7, 2020
@Carreau Carreau merged commit 3585368 into ipython:master Sep 7, 2020
2 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/ipython that referenced this pull request Sep 7, 2020
@minrk minrk deleted the multiple-extensions branch September 8, 2020 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants