Skip to content

Python VSC Project Cloning

This guide shows how to start working on a Git project for the first time.

Prerequisites

  1. you need to be added to the dev.azure.com py project. This should be done as part of the IT onboarding. In case of doubt, ask the Security Officer

Steps

Clone Repository

  1. in GitHub Desktop, go to File > Clone

  2. select GitHub.com

  3. enter the name of the project

  4. select the project

  5. Leave the local path unchanged

  6. Clone

    vsc-github-clone.png

VSC

  1. Open the project in VSC (NOTE: there are two modes: Open Folder, Open Workspace from File. If there is a *.code-workspace file in the root folder, then this is the preferable way)

    vsc-open-project.png

  2. Go to the python project in the WORKSPACE (e.g. *_af)

  3. point to the scripts folder

    vsc-workspace-py.png

  4. open a Terminal

  5. point to the python project

    vsc-terminal.png

  6. run the first script

  7. check that it runs through and creates a .venv folder

    vsc-py-script1.png

  8. IMPORTANT: close the terminal and reopen again. You should see a green (.venv) in the terminal. If you get an error that mentions execution policy, proceed as follows:

    1. Open PowerShell as an admin
    2. Run Set-ExecutionPolicy -ExecutionPolicy Bypass

      vsc-py-venv.png

  9. Run the next script 2_setup.ps1

  10. Run 3_pip.ps1

    1. Choose between 3_0_pip_editable.ps1 and 3_1_pip_non_editable.ps1
    2. 3_0_pip_editable.ps1 is for project development and should be used if a product is not ready to be deployed yet.
    3. 3_1_pip_non_editable.ps1 is being used if the product is ready for deployment and is within it's final stage for testing as the dependencies are being used from the .venv environment based on their last version they are added there.