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

Describe how to use this project with Jupyter Notebooks #1704

Closed
sobolevn opened this issue Oct 28, 2020 · 6 comments
Closed

Describe how to use this project with Jupyter Notebooks #1704

sobolevn opened this issue Oct 28, 2020 · 6 comments
Assignees
Labels
documentation Docs related task feature New feature or request help wanted Extra attention is needed level:starter Good for newcomers
Milestone

Comments

@sobolevn
Copy link
Member

sobolevn commented Oct 28, 2020

I get a lot of questions from users that what to use WPS together with IPython Notebooks.
Currently, you cannot just use it with raw flake8.

You need extra tooling and some tweaks in the configuration I suppose.
So, we need to document how to use it.

We can create a new entry in our Intergrations section. https://github.com/wemake-services/wemake-python-styleguide/tree/master/docs/pages/usage/integrations

@sobolevn sobolevn added feature New feature or request help wanted Extra attention is needed level:starter Good for newcomers documentation Docs related task labels Oct 28, 2020
@sobolevn sobolevn added this to the Version 0.15 aka Python3.9 milestone Oct 28, 2020
@orsinium
Copy link
Collaborator

orsinium commented Oct 29, 2020

For jupyterlab UI integration:
https://github.com/mlshapiro/jupyterlab-flake8

And for CLI, flakehell supports ipynb:
https://flakehell.readthedocs.io/parsers.html

@MarcoGorelli
Copy link
Contributor

MarcoGorelli commented Nov 5, 2020

Hi @sobolevn ,

We've released nbqa version 0.4.0, which has support for in-line magics. This should make it safe for use with wemake-python-styleguide.

Essentially, just as you would run

flake8 script.py

you can run

nqba flake8 notebook.ipynb

Any configuration in setup.cfg will be respected when running nbqa flake8.

I've tested this out on a few notebooks, and it seems to work as expected. If you could verify this we would really appreciate it!

@sobolevn
Copy link
Member Author

sobolevn commented Nov 5, 2020

@MarcoGorelli awesome news! Do you want to contribute a test case for us and some docs on how to use your library?

@MarcoGorelli
Copy link
Contributor

Sure!

Would you want a sample test notebook in tests/data and then a snapshot test? If so, I'll get a PR together over the weekend

@sobolevn
Copy link
Member Author

sobolevn commented Nov 5, 2020

Yes, fixtures/ looks like a good place for a notebook itself: https://github.com/wemake-services/wemake-python-styleguide/tree/master/tests/fixtures

And then snapshot the result 👍

Thanks!

@MarcoGorelli
Copy link
Contributor

closed in #1798 ? Looks like I'd forgotten the "closes #1704" tag there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Docs related task feature New feature or request help wanted Extra attention is needed level:starter Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants