B. Building the Pre-Configured Development Environment

The development environment used in this course is designed to be used simply by downloading and extracting a zip file.

This page describes how to build the development environment in case you want to troubleshoot a problem, customize some details, or build a similar environment on an OS other than the assumed one (Windows 64 bit).

B.1. Prerequisite

  • Windows 11 (64 bit)

B.2. Downloads

B.3. Installation

  • Create C:/cs1 (referred to as ${CS1_DIR} below).

  • Create an empty folder ${CS1_DIR}/home.

  • Create an empty folder ${CS1_DIR}/projects.

  • Extract WinPython64-3.13.15.0dot.zip and place its contents in ${CS1_DIR}/WPy64 (referred to as ${WinPy}).

  • Create ${CS1_DIR}/MinGit (referred to as ${MinGit}) and place the contents of MinGit-2.55.0.5-64-bit.zip in it.

  • Create ${CS1_DIR}/VSCodium-win32-x64 (referred to as ${VSCodium}) and place the contents of VSCodium-win32-x64-1.126.04524.zip in it [1].

  • Create an empty folder ${VSCodium}/data to use VSCodium in portable mode.

  • Put the following files in place:

    • ${CS1_DIR}/vscode_cs1.bat
    • ${CS1_DIR}/command_prompt_cs1.bat
    • ${CS1_DIR}/home/.gitconfig
    • ${CS1_DIR}/home/.config/git/ignore
    • ${WinPy}/settings/winpython.ini
    • ${VSCodium}/data/user-data/User/settings.json
  • Configure ${CS1_DIR}/home/.gitconfig with at least the following:

    [user]
        email = anonymous@example.org
        name = Computer Seminar I
    
    [init]
        defaultBranch = master
    
    [core]
        pager =
    
  • Run command_prompt_cs1.bat and install the Python packages:

    python -m pip install --upgrade pip
    python -m pip install pygame pylint ipython pytest pytest-watcher numpy ipykernel
    
  • Run vscode_cs1.bat, open the Extensions sidebar, and install:

    • Python (ms-python.python)
    • Python Debugger (ms-python.debugpy)
    • Pylint (ms-python.pylint)
    • BasedPyright (detachhead.basedpyright)
    • Jupyter (ms-toolsai.jupyter)
    • Git Graph (mhutchie.git-graph) [2]
    • Python Indent (kevinrose.vsc-python-indent)
    • Highlight (fabiospampinato.vscode-highlight)
  • Save the course settings in ${VSCodium}/data/user-data/User/settings.json. The distributed configuration fixes the interpreter to ${WinPy}/python/python.exe and disables automatic updates of VSCodium and its extensions.

[1]VSCodium.exe may be deleted by security software (this has occurred with McAfee LiveSafe). Configure the security software to exclude it from deletion.
[2]If Git Graph does not appear in the Extensions search results, obtain its VSIX file and install it with Extensions: Install from VSIX... from the Command Palette.

B.4. Preparation of Distribution File

After checking the environment, remove history information and temporary working files before compressing the entire cs1 folder into a zip file.

  • Make sure ${CS1_DIR}/home/.gitconfig does not contain personal information.

  • Record the Python package versions:

    python -m pip freeze > C:\cs1\PYTHON_PACKAGES.txt
    
  • Record the VSCodium extension list in ${CS1_DIR}/VSCODIUM_EXTENSIONS.txt.

  • Record the versions of Python, pygame, VSCodium, Git, etc. in ${CS1_DIR}/VERSIONS.txt.

  • Run File ‣ Open Recent ‣ Clear Recently Opened in VSCodium.

  • Quit VSCodium.

  • Delete ${VSCodium}/data/user-data/User/History if it exists.

  • Delete ${VSCodium}/data/user-data/User/workspaceStorage if it exists.

  • Make sure ${VSCodium}/data/user-data/User/settings.json remains in place.

  • Make sure the required extensions remain in ${VSCodium}/data/extensions.

  • Remove all contents of ${CS1_DIR}/projects, leaving the folder empty.

  • Compress the entire ${CS1_DIR} folder into a zip file.

  • Extract the resulting zip in a clean test environment and verify that Python, pygame, Git, and VSCodium start correctly from command_prompt_cs1.bat and vscode_cs1.bat.