Skip to content

Feature: add support for .py files in py:percent format#1436

Closed
lukastk wants to merge 3 commits intoAnswerDotAI:masterfrom
Autonomy-Data-Unit:py-percent-compatability
Closed

Feature: add support for .py files in py:percent format#1436
lukastk wants to merge 3 commits intoAnswerDotAI:masterfrom
Autonomy-Data-Unit:py-percent-compatability

Conversation

@lukastk
Copy link
Copy Markdown
Contributor

@lukastk lukastk commented Aug 22, 2024

  • Introduces the ability to handle .py files as py:percent files within nbdev.
    • Does this by converting .py files to .ipynb format as an intermediate step in NBProcessor.__init__
  • Added example of usage in 'nbs/api/04_export.ipynb'.

Can export all *.py files by running nbdev_export --file_glob '*.py'

See https://jupytext.readthedocs.io/en/latest/formats-scripts.html for info on the py:percent format.

- Introduces the ability to handle .py files as py:percent files within nbdev.
    - Does this by converting .py files to .ipynb format as an intermediate step in `NBProcessor.__init__`
- Added example of usage in 'nbs/api/04_export.ipynb'.

Can export all *.py files by running `nbdev_export --file_glob '*.py'`

See https://jupytext.readthedocs.io/en/latest/formats-scripts.html for info on the py:percent format.
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@lukastk lukastk changed the title Feature: add support for .py files in nbdev in py:percent format Feature: add support for .py files in py:percent format Aug 22, 2024
@lukastk
Copy link
Copy Markdown
Contributor Author

lukastk commented Aug 22, 2024

Related issue:
#1437

@jph00
Copy link
Copy Markdown
Contributor

jph00 commented Aug 27, 2024

This is a great feature! But I don't want to add these additional deps to nbdev. Could we make it an extension or some other kind of separate project? Or alternatively only enable these new features if these deps are installed (but not make them requirements)?

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