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

Support Jupytext #745

Merged
merged 27 commits into from Sep 18, 2022
Merged

Support Jupytext #745

merged 27 commits into from Sep 18, 2022

Conversation

MarcoGorelli
Copy link
Collaborator

closes #668

@MarcoGorelli MarcoGorelli marked this pull request as ready for review September 13, 2022 11:52
@MarcoGorelli MarcoGorelli changed the title WIP Support Jupytext Support Jupytext Sep 13, 2022
@MarcoGorelli
Copy link
Collaborator Author

Fairly confident about this - I've tried it out on a few projects, and haven't noticed any issues

@MarcoGorelli
Copy link
Collaborator Author

MarcoGorelli commented Sep 13, 2022

Just noticed this from pymc-examples:

--- a/myst_nbs/gaussian_processes/GP-MaunaLoa.myst.md
+++ b/myst_nbs/gaussian_processes/GP-MaunaLoa.myst.md
@@ -4,13 +4,11 @@ jupytext:
     extension: .md
     format_name: myst
     format_version: 0.13
-    jupytext_version: 1.13.7
+    jupytext_version: 1.14.1
 kernelspec:
   display_name: Python 3
   language: python
   name: python3
-substitutions:
-  extra_dependencies: bokeh

probably a blocker

EDIT: resolved, reported to jupytext mwouts/jupytext#994

@MarcoGorelli
Copy link
Collaborator Author

MarcoGorelli commented Sep 14, 2022

Another blocker:

-kernelspec:
-  name: python3
-  display_name: python3
 jupytext:
   text_representation:
     extension: .md
     format_name: myst
-    format_version: '0.13'
-    jupytext_version: 1.13.8
-execution:
-  timeout: 300
+    format_version: 0.13
+    jupytext_version: 1.14.1
+kernelspec:
+  display_name: python3
+  name: python3

maybe, should just...not overwrite the header? not sure if:

  • to consider this a bug in jupytext, and just defer to them
  • to not overwrite the header, ever

tempted to go with the latter, though it's perhaps slightly trickier? return header from read_notebook and pass it to write_notebook. use jupytext.jupytext.writes instead of jupytext.jupytext.write, and then replace the header before writing

gonna go with the former, but will try to get around it where possible. check mwouts/jupytext#656 for the execution one

@MarcoGorelli
Copy link
Collaborator Author

I've tried this out on a bunch of repos, and added tests, and it seems to work fine

Tempted to just merge, more issues will probably only be discovered if this gets out and people start using it

@MarcoGorelli MarcoGorelli merged commit b95808d into nbQA-dev:master Sep 18, 2022
@moshemoshe137
Copy link

Is support for mdformat being removed? It seems to disappear in 44d8ac8.

basnijholt added a commit to python-adaptive/adaptive that referenced this pull request Sep 19, 2022
This is now possible after nbQA-dev/nbQA#745 which solved this issue (nbQA-dev/nbQA#668) I opened a year ago.
basnijholt added a commit to python-adaptive/adaptive that referenced this pull request Sep 19, 2022
This is now possible after nbQA-dev/nbQA#745 which solved this issue (nbQA-dev/nbQA#668) I opened a year ago.
@MarcoGorelli
Copy link
Collaborator Author

I removed it from the docs, but you can still use it

@MarcoGorelli
Copy link
Collaborator Author

cc @OriolAbril as you're using jupytext, in case this is useful to you

basnijholt added a commit to python-adaptive/adaptive that referenced this pull request Apr 7, 2023
* Add NBQA for notebook and docs linting

This is now possible after nbQA-dev/nbQA#745 which solved this issue (nbQA-dev/nbQA#668) I opened a year ago.

* Run pre-commit filters on all files

* Lint

* bump

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* update os

* Fix all nbqa issues

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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.

How to use with Jupytext Markdown notebooks
2 participants