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

Can we turn off pycodestyle on AWS? #35

Open
mooreryan opened this issue Nov 25, 2024 · 7 comments
Open

Can we turn off pycodestyle on AWS? #35

mooreryan opened this issue Nov 25, 2024 · 7 comments

Comments

@mooreryan
Copy link
Collaborator

Every line is flagged in some of our notebooks. E.g., Submodule_1/Exercises/Submodule_1_Exercise_Pandas_Solution.ipynb. But they are pointless lints like "too many blank lines" or "imports not at the top".

It would be better to turn them off. There must be a way to do this on AWS....

@mooreryan
Copy link
Collaborator Author

(E303 too many blank lines)

@mooreryan
Copy link
Collaborator Author

You can create a file called ~/.config/pycodestyle with this in it:

[pycodestyle]
ignore = E303

and SageMaker notebooks will pick it up. But it seems to ignore any of the standard locations in the repository itself, so I'm not sure if we can just include a config in the git repo.

See:

@mooreryan
Copy link
Collaborator Author

mooreryan commented Nov 26, 2024

Yeah I have no idea......this is clearly not the intended behavior:

aws_sagemaker_jupyterlab_pycodestyle_e303

I can't find a way to get jupyterlab to pick up config files that are local to the repository (which would be ideal, so that the user won't have to configure it themselves).

So as far as I can tell, the user will have to deal with this unfortunately--either by setting a pycodestyle config in their ~/.config on SageMaker, or using the JupyterLab gui settings control to turn pycodestyle off.

Also, apparently you can't submit a support ticket to amazon without a paid support plan.

@mooreryan
Copy link
Collaborator Author

mooreryan commented Nov 26, 2024

@kyleoconnell-NIH, @masmontgomery -- any ideas about this?

@masmontgomery
Copy link
Collaborator

So the config file way isn't working? I haven't worked with that aspect before, though it does sound better if it can work. The most straightforward way would be putting code at the top of each notebook to set ast_node_interactivity to none. Students could turn it back on if they really want to know how they're violating PEP8 formatting.

@mooreryan
Copy link
Collaborator Author

So the config file way isn't working?

The AWS SageMaker JupyterLab picks the config file up if it is located here: ~/.config/pycodestyle. I have tried the same config in files named pycodestyle, pycodestyle.cfg, setup.cfg, and tox.ini, in each directory under the repository (ed at the root, in the Submodule_X dir, in the Submodule_X/Tutorialr, etc; however, those seem not to work in SageMake JupyterLab.

Users can also turn off the linting errors in the JupyterLab settings on AWS.

The annoying thing about it is that these errors only popped up recently...not sure what that is about.

I tried setting the ast_node_interactivity, but the issue is the "squiggles" from the LSP that jupyterlab is running I think.

@mooreryan
Copy link
Collaborator Author

The simplest option is probably to instruct users to do this:

Settings > Settings Editor > Language Servers > pylsp > uncheck pylsp.plugins.pycodestyle.enabled

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

No branches or pull requests

2 participants