#30408 closed enhancement (fixed)
Add pycodestyle config via tox, add tox environment
Reported by: | gh-tobiasdiez | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | sage-9.2 |
Component: | build | Keywords: | |
Cc: | mkoeppe, chapoton | Merged in: | |
Authors: | Tobias Diez, Matthias Koeppe | Reviewers: | Matthias Koeppe, Tobias Diez |
Report Upstream: | N/A | Work issues: | |
Branch: | 939e9e0 (Commits, GitHub, GitLab) | Commit: | |
Dependencies: | Stopgaps: |
Description
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 https://github.com/sagemath/sage-patchbot/pull/145.
Documentation will be added in #30361.
Change History (17)
comment:1 Changed 2 years ago by
- Status changed from new to needs_review
comment:2 follow-up: ↓ 4 Changed 2 years ago by
comment:3 follow-up: ↓ 17 Changed 2 years ago by
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?
comment:4 in reply to: ↑ 2 ; follow-ups: ↓ 5 ↓ 6 Changed 2 years ago by
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.
comment:5 in reply to: ↑ 4 Changed 2 years ago by
Replying to gh-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
comment:6 in reply to: ↑ 4 Changed 2 years ago by
Replying to gh-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
comment:7 Changed 2 years ago by
- Commit changed from 1cedc00fe789a4573c926cbff12e6fb9d2422c1e to dde3b4f3955605d27e30f488c6dc11157031b720
Branch pushed to git repo; I updated commit sha1. New commits:
dde3b4f | src/tox.ini: Add testenv:pycodestyle
|
comment:8 Changed 2 years ago by
comment:9 Changed 2 years ago by
- Commit changed from dde3b4f3955605d27e30f488c6dc11157031b720 to 939e9e0e08d7d5c4e4c073a571ca8e4aac22ef77
Branch pushed to git repo; I updated commit sha1. New commits:
939e9e0 | src/tox.ini: Better default arg testenv:pycodestyle
|
comment:10 Changed 2 years ago by
This auto-provisions pycodestyle
Can do the same also for pyright via https://pypi.org/project/nodeenv/
comment:11 follow-up: ↓ 13 Changed 2 years ago by
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 ;-).
comment:12 Changed 2 years ago by
- Summary changed from Add pycodestyle config via tox to Add pycodestyle config via tox, add tox environment
comment:13 in reply to: ↑ 11 Changed 2 years ago by
Replying to gh-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.
comment:14 Changed 2 years ago by
- Reviewers set to Matthias Koeppe, Tobias Diez
comment:15 Changed 2 years ago by
- Status changed from needs_review to positive_review
comment:16 Changed 2 years ago by
- Branch changed from public/build/pycodestyleConfig to 939e9e0e08d7d5c4e4c073a571ca8e4aac22ef77
- Resolution set to fixed
- Status changed from positive_review to closed
comment:17 in reply to: ↑ 3 Changed 2 years ago by
- Commit 939e9e0e08d7d5c4e4c073a571ca8e4aac22ef77 deleted
Perhaps also add a tox environment that runs pycodestyle?