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 pycodestyle config via tox, add tox environment #30408

Closed
tobiasdiez opened this issue Aug 20, 2020 · 17 comments
Closed

Add pycodestyle config via tox, add tox environment #30408

tobiasdiez opened this issue Aug 20, 2020 · 17 comments

Comments

@tobiasdiez
Copy link
Contributor

Adds the current configuration of pycodestyle (as taken from the patchbot) to the src/tox.ini file. Thus, it can be run now locally via the cli pycodestyle. Moreover, tools like VS Code can pick it up automatically. The corresponding changes for the patchbot are done in sagemath/sage-patchbot#145.

Documentation will be added in #30361.

CC: @mkoeppe @fchapoton

Component: build

Author: Tobias Diez, Matthias Koeppe

Branch: 939e9e0

Reviewer: Matthias Koeppe, Tobias Diez

Issue created by migration from https://trac.sagemath.org/ticket/30408

@tobiasdiez tobiasdiez added this to the sage-9.2 milestone Aug 20, 2020
@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 20, 2020

comment:2

Perhaps also add a tox environment that runs pycodestyle?

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 20, 2020

comment:3

Speaking of vs code, would it make sense to add a configuration or configuration template for that as well in ~/.vscode so that it knows to launch local/bin/sage and local/bin/python3?

@tobiasdiez
Copy link
Contributor Author

comment:4

Perhaps also add a tox environment that runs pycodestyle?

I've no experience with tox, and thus cannot decide if this makes sense or not. Feel free to hijack this PR and add the necessary config.

Speaking of vs code, would it make sense to add a configuration or configuration template for that as well in ~/.vscode so that it knows to launch local/bin/sage and local/bin/python3?

This definitely makes sense! However, the last time I tried to point vscode to the local sage python environment, it didn't work. My hope was that with the inplace compilation it will work.

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 20, 2020

comment:5

Replying to @tobiasdiez:

Speaking of vs code, would it make sense to add a configuration or configuration template for that as well in ~/.vscode so that it knows to launch local/bin/sage and local/bin/python3?

This definitely makes sense! However, the last time I tried to point vscode to the local sage python environment, it didn't work. My hope was that with the inplace compilation it will work.

I was able to set it so that it can run local/bin/python3 and that was good enough to do some debugging work

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 20, 2020

comment:6

Replying to @tobiasdiez:

Perhaps also add a tox environment that runs pycodestyle?

I've no experience with tox, and thus cannot decide if this makes sense or not. Feel free to hijack this PR and add the necessary config.

Sure, will do

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 20, 2020

Changed commit from 1cedc00 to dde3b4f

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 20, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

dde3b4fsrc/tox.ini: Add testenv:pycodestyle

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 20, 2020

Author: Tobias Diez, Matthias Koeppe

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 20, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

939e9e0src/tox.ini: Better default arg testenv:pycodestyle

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 20, 2020

Changed commit from dde3b4f to 939e9e0

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 20, 2020

comment:10

This auto-provisions pycodestyle

Can do the same also for pyright via https://pypi.org/project/nodeenv/

@tobiasdiez
Copy link
Contributor Author

comment:11

Thanks!

If you want to enable type checking in a purely pythonic environment, then perhaps mypy (or pytype or PyCharm) are better alternatives. Pyright was mainly designed to be used in combination with VS code and for CI. Anyway, that's not the topic of this ticket ;-).

@mkoeppe mkoeppe changed the title Add pycodestyle config via tox Add pycodestyle config via tox, add tox environment Aug 20, 2020
@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 20, 2020

comment:13

Replying to @tobiasdiez:

Pyright was mainly designed to be used in combination with VS code and for CI. Anyway, that's not the topic of this ticket ;-).

OK, I've opened #30411 for this, but it's not a high priority to work on it.

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 20, 2020

Reviewer: Matthias Koeppe, Tobias Diez

@vbraun
Copy link
Member

vbraun commented Aug 26, 2020

Changed branch from public/build/pycodestyleConfig to 939e9e0

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 1, 2020

comment:17

Replying to @mkoeppe:

Speaking of vs code, would it make sense to add a configuration or configuration template for that as well in ~/.vscode so that it knows to launch local/bin/sage and local/bin/python3?

This is now #30484

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 1, 2020

Changed commit from 939e9e0 to none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants