Skip to content

Latest commit

 

History

History
140 lines (97 loc) · 3.48 KB

File metadata and controls

140 lines (97 loc) · 3.48 KB

Dev Set up


Install Python 3.7

https://www.python.org/downloads/release/python-379/



Set up JDK 1.8

  1. Download JDK from here

  2. Set JAVA_HOME:

    • Linux/Mac instructions here
    • Windows instructions here


Download and Install Pycharm community edition

https://www.jetbrains.com/pycharm/download

Pycharm setting - Set up python virtual environment interpreter

Note:

  • Make sure name is ".venv", as this is already set in .gitignore as a file to be ignored while committing to git. Else choose the name and make sure to add it to gitignore
  • Close and open the terminal after this step to switch to ".venv"

python-interpreter

Pycharm setting - Set up integrated tools like test runner, docstring format, etc.

python-integrated-tools

Pycharm setting - Point to pylint config file

pylint

Pycharm setting - Make sure to include the main package name for import to pick up the auto-completion of your package name

python-integrated-tools



Upgrade pip

Note: Open terminal in PyCharm

python -m pip install -U pip

Upgrade pip



Set below Environment variables in three sections

  1. Key: PBM_LOG_FILE_PATH
    • Value example: "/var/log/data-engineering.log"

Note: More environment variables information is in this python environment mapper file

Section 1: Set environment variables for running the programs

Go to Run -> Edit Configurations -> Templates -> Python Set Environment Variable

Set Environment Variable

Section 2: Set environment variables for test cases

Go to Run -> Edit Configurations -> Templates -> Python tests -> Unittests Set Environment Variable

Section 3: Set environment variables for running commands in terminal

Go to Preferences -> Tools -> Terminal -> Set Environment Variable

Note: Environment variable values need not be same for all 3 sections. In-fact, they are meant to be different. For example, you might want to set log level to DEBUG in some cases.



Install python packages

Note: Open terminal in PyCharm

pip install -r requirements.txt

Install python package



Enable pre-commit

Use the pre-commit hook for linting staged files prior to a commit (mandatory, triggers pydocstyle and pylint)

pre-commit install --hook-type pre-commit

Example

Pre-commit check


Git helpers

  1. Run below to save credentials - to avoid entering credentials for every push
git config credential.helper store
  1. Allow long file name
git config core.longpaths true