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

Add Robot Framework (.robot) -language support #378

Merged
merged 6 commits into from
Nov 9, 2019

Conversation

datakurre
Copy link
Contributor

  • document the language extension and comment by adding one line to _SCRIPT_EXTENSIONS in languages.py.
  • contribute a sample notebook in tests/notebooks/ipynb_[language].
  • add two tests in test_mirror.py: one for the light format, and another one for the percent format.
  • Make sure that the tests pass, and that the text representations of your notebook, found in tests/notebooks/mirror/ipynb_to_script and tests/notebooks/mirror/ipynb_to_percent, are valid scripts.

@codecov
Copy link

codecov bot commented Nov 8, 2019

Codecov Report

Merging #378 into master will decrease coverage by 0.15%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #378      +/-   ##
=========================================
- Coverage   99.05%   98.9%   -0.16%     
=========================================
  Files          75      75              
  Lines        7431    7273     -158     
=========================================
- Hits         7361    7193     -168     
- Misses         70      80      +10
Impacted Files Coverage Δ
jupytext/languages.py 100% <ø> (ø) ⬆️
jupytext/pep8.py 95.23% <0%> (-4.77%) ⬇️
jupytext/jupytext.py 98.59% <0%> (-1.41%) ⬇️
jupytext/cli.py 95.48% <0%> (-0.85%) ⬇️
jupytext/cell_reader.py 96.75% <0%> (-0.19%) ⬇️
tests/test_pep8.py 98.36% <0%> (-0.03%) ⬇️
tests/test_cli.py 100% <0%> (ø) ⬆️
tests/test_black.py 100% <0%> (ø) ⬆️
tests/test_active_cells.py 100% <0%> (ø) ⬆️
tests/test_knitr_spin.py 100% <0%> (ø) ⬆️
... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 700f03a...cae75da. Read the comment docs.

@mwouts
Copy link
Owner

mwouts commented Nov 9, 2019

Awesome! Thank you @datakurre . By the way I see that the instructions for adding a new language were not completely up-to-date (adding test functions is not required any more), so I've fixed them.

Thanks again for your contribution!

@mwouts mwouts merged commit 645cfc8 into mwouts:master Nov 9, 2019
@datakurre
Copy link
Contributor Author

Awesome! Thanks for polishing things up! We will bundle this with
https://robots-from-jupyter.github.io/

@mwouts
Copy link
Owner

mwouts commented Nov 9, 2019

I am looking forward to seeing that! Just to let you know, I hope to release the next version (1.3) within one or two weeks.

@datakurre
Copy link
Contributor Author

Bundled! https://github.com/robots-from-jupyter/robotlab/releases/tag/v2019.12.0

jupytext-robot

Thank you! .robot => .ipynb conversion from new .robot-file needs some work, but that probably something I knowing the robot format should contribute 😄 .robot files converted from .ipynb-notebooks work as expected.

@mwouts
Copy link
Owner

mwouts commented Dec 12, 2019

Awesome! Thanks for letting me know.

.robot => .ipynb conversion from new .robot-file needs some work, but that probably something I knowing the robot format should contribute

Tell me a bit more about the issue... Maybe we'll have to improve the format documentation? Also, did you give a try to the percent format? It's a bit more verbose as every cell needs to be prefixed with # %%, but maybe it's easier to use as it is more explicit.

@datakurre
Copy link
Contributor Author

@mwouts Better late than never. Thank you.

jupytext --from robot:percent foo.robot --to ipynb

works well enough. Unprepared .robot will become a single big cell, which is easy to split with Jupyter Notebook or Lab. And after this "initial import", light format works well.

This is reasonable workflow.

@mwouts
Copy link
Owner

mwouts commented Jan 11, 2020

Hi @datakurre , you're welcome! And thank you for your contribution as well!

Oh yes, using the percent format on a non-percent file will give just one cell. But maybe your experience with the light format not able to parse a script means that we may want to improve it - do not hesitate if you can share one of the robot scripts that is not correctly parsed!

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