You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python version (& distribution if applicable, e.g., Anaconda): Python 3.13.1 @ conda 23.11.0
Type of virtual environment used (e.g., conda, venv, virtualenv, etc.): conda
Operating system (and version): Windows 11 Home ; OS build 26100.2605
Version of tool extension you are using:
2024.0.0
Behaviour
Expected Behavior
Formatter does not move import order & lines past none-empty lines to prevent import issues
Actual Behavior
The formatter moves import lines to the very top of the file, regardless of any code in between. This can be fatal when importing relative packages from local paths using
sys.path.append(). As a result, imports imported from local added paths will no longer be able to be imported.
Did running it from the command line work?
Yes, but same output.
This means that the issue is in autopep8 itself. This repo is for the VS Code extension that wraps the autopep8 library to provide integration with VS Code, please file the issue here: https://github.com/hhatto/autopep8
Diagnostic Data
2024.0.0
Behaviour
Expected Behavior
Formatter does not move import order & lines past none-empty lines to prevent import issuesActual Behavior
The formatter moves import lines to the very top of the file, regardless of any code in between. This can be fatal when importing relative packages from local paths usingsys.path.append()
. As a result, imports imported from local added paths will no longer be able to be imported.Reproduction Steps:
Logs:
Click here for detailed logs
2024-12-30 18:07:54.892 [info] [Trace - 6:07:54 PM] Sending request 'textDocument/formatting - (3)'. 2024-12-30 18:07:54.896 [info] [Trace - 6:07:54 PM] Received notification 'window/logMessage'. 2024-12-30 18:07:54.896 [info] CONDA_PATH\anaconda3\envs\VENV_NAME\python.exe -m autopep8 - 2024-12-30 18:07:54.896 [info] [Trace - 6:07:54 PM] Received notification 'window/logMessage'. 2024-12-30 18:07:54.896 [info] CWD Server: REPO_PATH 2024-12-30 18:07:55.119 [info] [Trace - 6:07:55 PM] Received response 'textDocument/formatting - (3)' in 227ms. 2024-12-30 18:07:55.127 [info] [Trace - 6:07:55 PM] Sending notification 'textDocument/didChange'.Outcome When Attempting Debugging Steps:
Did running it from the command line work?
Yes, but same output.
Extra Details
The text was updated successfully, but these errors were encountered: