Open magnus-puresalmon opened 2 months ago
I also tried hacking around the version requirement by editing the source of pycodestyle so it declared support for 2.7, but that broke because pycodestyle 2.9.1 uses f-string syntax which is unavailable when built for 2.7. On the other hand, autopep8 1.7.0 using pycodestyle 2.8.0 succesfully parses, but fails at runtime due to a unicode-string error (so it is very likely 1.7.0 shouldn't even declare support for python 2.7)
I also had to change a line of code in the VSCode extension so it could read stderr and not stdout, because apparently autopep8 1.7.0 emits --version
info to stderr
instead of stdout
for some reason.
VSCode settings (username omitted):
{
"python.analysis.typeCheckingMode": "off",
"[python]": {
"editor.defaultFormatter": "ms-python.autopep8"
},
"autopep8.importStrategy": "fromEnvironment",
"autopep8.path": [
"C:/Users/username/AppData/Local/Python/2.7/Scripts/autopep8.exe"
],
"autopep8.interpreter": [
"C:/Users/username/AppData/Local/Python/Python311-32/python.exe"
]
}
I am, unfortunately, working on a system that is stuck on 2.7 (specifically it's stuck on using jython, which is itself stuck on 2.7). I wanted to get a code formatter for VSCode that could help, found this GitHub issue: https://github.com/microsoft/vscode-python/discussions/21991 and tried doing method 1 there, but I could not install 1.7.0 due to a dependency on pycodestyle 2.9.1, which doesn't support Python 2.7
While I'd like for this to result in some minimal work to make 1.7.0 use a 2.7 compliant version of pycodestyle, I'd expect it'd be simpler to declare 1.7.0 as not supporting 2.7 (which would make the solution where I'm using autopep8 extension for VSCode break, since the extension requires autopep8>=1.7.0 for the autopep8 version if using an external file)
Command Line
Your Environment