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

Refactor to avoid cycle #423

Merged
merged 4 commits into from
Sep 22, 2016
Merged

Conversation

mpacer
Copy link
Member

@mpacer mpacer commented Sep 20, 2016

So this addresses the same issues as #417 but tries to do so by abstracting the hardcoded, deprecated exporter locating into a separate module from the entrypoint based exporter functionality which is not deprecated and instead is maintained in base.py.

The only thing I don't like is that it introduces a new file that is strictly speaking deprecated because thought it is only acting as a shim for the export module that doesn't conflict with the name-space, all of its contents are deprecated.

Another solution would be to just leave all the deprecated functionality inside export.py since it's deprecated anyway. I just worry that people might still use export and as a result be confused (and the ambiguity will strictly speaking continue to be present either way). I can make that change but it's not what I'd originally proposed, so I'll make the PR originally of what I proposed, and then will change it if that accords with others' intuitions about which is better.

@mpacer
Copy link
Member Author

mpacer commented Sep 20, 2016

Note — the most important change for demonstrating the improvement is in script.py; previously if we had moved that import there it would have failed to find get_exporter (because of the cyclic dependency).

@Carreau
Copy link
Member

Carreau commented Sep 21, 2016

LGTM, but need rebase.

from .base import (export, get_exporter,
get_export_names , ExporterNameError)

from .exporter import Exporter
Copy link
Member

Choose a reason for hiding this comment

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

Nitpicking: Exporter is unused, but I guess that would brea API to remove it ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Exactly. So should we keep it?

Copy link
Member

Choose a reason for hiding this comment

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

Sure. Let's merge once you get your rebase right.

@mpacer mpacer force-pushed the refactor_to_avoid_cycle branch 3 times, most recently from fb52cf4 to 5eaddad Compare September 21, 2016 19:03
@Carreau
Copy link
Member

Carreau commented Sep 21, 2016

BTW mike can you try to install this

@Carreau Carreau merged commit e232ccf into jupyter:master Sep 22, 2016
@mpacer
Copy link
Member Author

mpacer commented Sep 22, 2016

done!

@Carreau
Copy link
Member

Carreau commented Sep 22, 2016

Good.

BTW mike can you try to install this

That was to show that with the extensions you can see the files coverage:
screen shot 2016-09-22 at 10 20 13

And per line coverage in the diff:

screen shot 2016-09-22 at 10 20 17

@mpacer mpacer modified the milestone: 5.0 Oct 20, 2016
vidartf added a commit to vidartf/jupyterlab_nbconvert_nocode that referenced this pull request Apr 23, 2021
[This change in nbconvert](jupyter/nbconvert#1273) meant that importing `from nbconvert.nbconvertapp import NbConvertApp` in  the global scope causes a circular import. That change seems to undo the efforts of jupyter/nbconvert#423, so there might be case to be made to clean it up on the nbconvert side, but this change should at least make this module workable with nbconvert 6 for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants