IDE Integrations: Python

Last update: 20 Oct 2023 [History] [Edit]

Available Integrations

The following files/symbolic links are available in the build directory

  • env.txt: a file containing full PYTHONPATH of the build environment
  • ide_python: a symbolic link to the python executable used by Athena
  • ide_flake8: an executable flake8 wrapper using Athena build environment
  • ide_autopep8: an executable autopep8 wrapper using Athena build environment

All provided executables can be used outside of Athena setup on a compatible machine (i.e. CentOS 7 if you use a CentOS 7 build of Athena).

VS Code Example

The following settings are configured in the Athena repository by default:

{
    "python.defaultInterpreterPath": "${workspaceFolder}/../build/ide_python",
    "python.envFile": "${workspaceFolder}/../build/env.txt",
    "python.formatting.provider": "autopep8",
    "python.formatting.autopep8Path": "${workspaceFolder}/../build/ide_autopep8",
    "python.linting.enabled": true,
    "python.linting.pylintEnabled": false,
    "python.linting.flake8Enabled": true,
    "python.linting.flake8Path": "${workspaceFolder}/../build/ide_flake8",
    "python.linting.flake8Args": [
        "--isolated",
        "--select=ATL,F,E101,E7,E9,W6",
        "--ignore=E701,E702,E704,E741",
        "--enable-extensions=ATL902"
    ]
}

No extra action is needed from your side to use the integrations as long as your build directory is at the same level as the source directory and named build.

Available Features

  • Python autocomplete that understands Athena packages.

  • The same flake8 checks that run with the Athena build also run automatically in the editor as you code (including ATLAS-specific checks).

  • autopep8-based formatting without installing any additional software.