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

Correct behavior of ipynb compile config #3201

Merged
merged 2 commits into from Jan 6, 2019
Merged

Conversation

fehiepsi
Copy link
Contributor

@fehiepsi fehiepsi commented Jan 6, 2019

Pull Request Checklist

  • I’ve read the guidelines for contributing.
  • I updated AUTHORS.txt and CHANGES.txt (if the change is non-trivial) and documentation (if applicable).
  • I tested my changes.

Description

We should use Traitlets config's merge method to update default config from IPYNB_CONFIG, rather than relies on dict's update. The update method erases the content of Config(self.site.config['IPYNB_CONFIG']) when both get_default_jupyter_config() and self.site.config['IPYNB_CONFIG']) have the same Exporter key.

@Kwpolska
Copy link
Member

Kwpolska commented Jan 6, 2019

What does Config.merge do differently?

Fix some typos for `conf.py`.
@fehiepsi
Copy link
Contributor Author

fehiepsi commented Jan 6, 2019

@Kwpolska config.merge recursively updates subconfigs. The current behavior gives KeyError when Exporter appears in default_config:

c1 = Config({"Exporter": {"a": True}})
c2 = {"Exporter": {"b": True}}
c1.update(c2)
c1.Exporter.a  # KeyError
c1 = Config({"Exporter": {"a": True}})
c2 = {"Exporter": {"b": True}}
c1.update(Config(c2))
c1.Exporter.a  # get LazyConfigValue
c1 = Config({"Exporter": {"a": True}})
c2 = {"Exporter": {"b": True}}
c1.merge(Config(c2))
c1.Exporter.a  # get True

@Kwpolska Kwpolska merged commit f4d0230 into getnikola:master Jan 6, 2019
@Kwpolska
Copy link
Member

Kwpolska commented Jan 6, 2019

Thanks for fixing this!

@fehiepsi
Copy link
Contributor Author

fehiepsi commented Jan 6, 2019

@Kwpolska Are you sure that we can merge this? I can see Travis failed for this PR. :(

@Kwpolska
Copy link
Member

Kwpolska commented Jan 6, 2019

The test failures seem to come from pytest pytest-cov==2.6.0 being incompatible with pytest==4.1.0, not your fix.

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.

None yet

2 participants