-
Notifications
You must be signed in to change notification settings - Fork 9
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
Split install and configure commands #38
Conversation
Codecov Report
@@ Coverage Diff @@
## master #38 +/- ##
========================================
- Coverage 98.3% 98.1% -0.2%
========================================
Files 8 8
Lines 357 381 +24
========================================
+ Hits 351 374 +23
- Misses 6 7 +1
|
@@ -44,10 +46,18 @@ def main( | |||
help="Show nbautoexport version.", | |||
), | |||
): | |||
"""Exports Jupyter notebooks to various file formats (.py, .html, and more) upon save, | |||
automatically. | |||
"""Automatically export Jupyter notebooks to various file formats (.py, .html, and more) upon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah just noticing that typer
very nicely adjusts the width of these docstrings when they are printed out in the command line. Now the docstrings can be written with column width of 100 in the source code, but printed out to column width of 80 for the 0.1% of ppl who use ancient monitors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this actually annoyed me recently for a different project where I wanted to put some ASCII art in my help string but typer
totally destroyed it with formatting. 😂 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing stuff! One strange thing about mocking the Jupyter config directory in the tests, then it's good to go.
@r-b-g-b I think the issue you had should be fixed. Ready for another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All set!
|
||
|
||
def test_configure_no_jupyter_config_warning(tmp_path, monkeypatch): | ||
monkeypatch.setenv("JUPYTER_CONFIG_DIR", str(tmp_path)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Splitting
install
commandinstall
into two commands:install
installs the post-save hook initialization in the Jupyter configconfigure
creates the.nbautoexport
configuration file in a directoryconfigure
command, if the post-save hook initialization is absent or out-of-date, there will be a warning printed.--jupyter-config
option toinstall
if user wants to install the post-save hook initialization to a Jupyter config in a nonstandard location.Other
clean
configuration option was not being passed throughinstall_sentinel
. Fixed by changing the interface ofinstall_sentinel
to accept a config object instead specifying each option. This reduces likelihood of similar future bugs by reducing the number of places that reproduce theNbAutoexportConfig
interface.pkg_resources.parse_version
withpackaging.version.parse
. This is whatpkg_resources
calls under the hood and is a lighter-weight dependency..codecov
configuration to:reach
graph, which I never found that interpretable but is really visually obnoxious.Closes #34. I did not unify the naming and opened #37 separately to avoid adding noise to this PR's diff.