Skip to content

Latest commit

 

History

History
51 lines (38 loc) · 1.77 KB

working-with-bin-scripts.md

File metadata and controls

51 lines (38 loc) · 1.77 KB

Working with bin Scripts

To work on the Python scripts in bin/ directory, in IntelliJ IDEA, add import the directory as a module.

  1. Open Project Structure (cmd + ;).
  2. In Project Settings -> Modules, choose the project name from the list. Press the + button, and choose Import Module from the dropdown.
  3. Open the bin/ directory in the file explorer.
  4. In the Import Module modal that comes up, do the following steps:
    1. Choose Create module from existing sources, press Next.
    2. Check the correct location on the list, press Next.
    3. Choose correct Python interpreter on the list of SDKs (if it's not on the list, it must be added there [just point to the Python executable]), press Next.
    4. Press Finish.
    5. Press Apply and exit the Project Structure window with OK button.

Install requirements

pip install -r bin/requirements.txt

Envars

Some scripts require environment variables set. To unset them, use this one-liner:

for var in $(export | grep -E '(POSTGRES|SPRING)' | awk -F'=' '{print $1}'); do unset "$var"; done

Note that in the above code snippet, grep's use of -E flag may not work outside of macOS.

More help

Each script supports --help option that displays the docstring of the script. Use that to display all information about the script.

Warnings/errors

No Python interpreter configured for the module

  1. Press the Configure Python interpreter button on the warning, or go straight to Project Structure (cmd + ;).
  2. Choose bin module on the list.
  3. On the right-hand side, choose Module SDK to the right Python version.
  4. Save the changes by pressing Apply and OK buttons. The warning should go away after IntelliJ IDEA re-indexes the module changes.