Setup
VSCode
We will be using Visual Studio Code (VSCode) for Python assignments in this course. Download and install it here: https://code.visualstudio.com/
Do not enable the AI autocomplete -- it can harm students' learning at this stage, so it is not allowed for this course.
(You are allowed to use other IDEs if you prefer, but you will need to set up the extensions yourself, and we cannot guarantee support for it during office hours.)
VSCode Extensions
Pylint
We will use Pylint (documentation here) to check that our code follows the style guidelines. The autograder for each assignment will also be running Pylint.
How to set up the Pylint VSCode extension:
- In VSCode, go to the "Extensions" tab on the left. It looks like this:
- Search for and install "Pylint"
- Then, go to VSCode's Settings menu
- Mac:
Code
>Settings...
>Settings
(orCmd
+,
) - Windows:
File
>Preferences
>Settings
(orCtrl
+,
)
- Mac:
- Navigate to
Extensions
>Pylint
- In the
Args
section, add:--disable=import-error
MyPy
We will use MyPy (documentation here) to enforce Python's built-in type checking. The assignment autograders will also be running MyPy.
How to set up the MyPy VSCode extension:
- In VSCode, go to the "Extensions" tab on the left. Search for and install "Mypy Type Checker"
- Then, go to VSCode's Settings menu
- Mac:
Code
>Settings...
>Settings
(orCmd
+,
) - Windows:
File
>Preferences
>Settings
(orCtrl
+,
)
- Mac:
- Navigate to
Extensions
>Mypy Type Checker
- In the
Args
section, add these four args:--strict
--disallow-untyped-defs
--disable-error-code=empty-body
--explicit-package-bases
Now, any missing or mismatched types will be reported in the "Problems" tab every time you save or open a file:
- Mac:
Cmd
+Shift
+M
- Windows:
Ctrl
+Shift
+M
If MyPy is set up properly, then this code:
def add(num1: int, num2) -> int:
return num1 + num2
result: str = add(3, 'hi')
def func() -> int:
pass
should result in three errors: num2
's missing type, add()
's returning something other than the promised int
, and result
's value being an int
when the variable type is str
.
If there is an error about func()
missing a return, then the arg --disable-error-code=empty-body
was not specified correctly in the settings.
Git and GitHub
GitHub account
Sign up for a GitHub account if you don't already have one. (While you could create a second account for this course, managing keys for multiple accounts is difficult, so we don't recommend it.)
We will be using git from the command line. Do not perform these operations with a GUI.
Be sure to use the same email address for your GitHub account and your computer's installation of git.
git installation
- Windows:
- First, install Git for Windows. This includes Git Bash, which adds a Linux-like command line to Windows.
- When it asks whether you would like to use a credential manager, say no (because we will be creating and managing keys ourselves). Otherwise, everything else should be the default option.
- Once it is installed, pin it to your taskbar by:
- Open
git-bash.exe
(which should be inLocal Disk (C:)
->Program Files
->Git
) - When it opens, right click on the icon in the Taskbar and select
Pin to taskbar
- Open
- Configure it to always open in your home directory by:
- Right click on it in the Taskbar and then right click on
Git Bash
- Left click on
Properties
- In the
Target
section, click at the end of what's already entered ("C:/Program Files/Git/git-bash.exe"
). After that last quotation mark, type in--cd-to-home
(including the space before the dashes) - Click
Apply
- Right click on it in the Taskbar and then right click on
- Mac or Linux:
- Open the Terminal app and enter "git" to see if it is installed. If not, install it here: 1.5 Getting Started - Installing Git (Pro Git).
- You may have to deal with an xcrun error.
git configuration
Then, open Git Bash or a terminal window and use these commands from 1.6 Getting Started - First-Time Git Setup (Pro Git) to configure git:
git config --global user.name "FirstName LastName"
(fill in your FirstName and LastName)git config --global user.email email@northeastern.edu
(fill in the email address you used for GitHub)git config --global init.defaultBranch main
git config --list
(check that the output looks correct)
Connect your GitHub account with your computer's installation of git
Here is a summary of the steps in Generating a new SSH key and adding it to the ssh-agent:
- Step 1: Open Git Bash (Windows) or the Terminal (Mac or Linux) and enter
ssh-keygen -t ed25519 -C "your_email@example.com"
(fill in your GitHub account email) to generate a new SSH key. We recommend using the default filename. Note: the characters will not appear as you are typing your password (it's invisible). - Step 2 for Windows:
- Open Windows PowerShell as administrator (right click on the app and click "Run as Administrator")
- Enter this to start an SSH agent:
Get-Service -Name ssh-agent | Set-Service -StartupType Manual
Start-Service ssh-agent
-
Back in Git Bash, enter this:
ssh-add c:/Users/YOU/.ssh/id_ed25519
with the "YOU" replaced with your username (which you can see in the top of the Git Bash window, betweenUsers/
and/.ssh
) -
Then, still in Git Bash, copy the SSH public key to your clipboard:
clip < ~/.ssh/id_ed25519.pub
-
Step 2 for Mac or Linux:
- In the Terminal, start an SSH agent by entering
eval "$(ssh-agent -s)"
- Edit the SSH config file to load keys into the agent by:
- Check if the file exists (
open ~/.ssh/config
) - If it doesn't exist, create it (
touch ~/.ssh/config
) - Open the file
~/.ssh/config
and add this to the end of it:
- Check if the file exists (
- In the Terminal, start an SSH agent by entering
Host github.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_ed25519
-
- Add your SSH private key to the ssh-agent:
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
- Copy the SSH public key to your clipboard:
pbcopy < ~/.ssh/id_ed25519.pub
- Add your SSH private key to the ssh-agent:
-
Step 3 for everybody:
- In a browser, go to github.com and log in. Then, in the upper-right corner, click your profile picture, then click
Settings
- In the
Access
section of the sidebar, clickSSH and GPG keys
and thenNew SSH key
orAdd SSH key
- In the
Title
field, add a descriptive label for the new key that describes your laptop, such as "2025 MacBook Pro". - In the
Key
field, paste your public key, which should be on your clipboard from when you copied it earlier - Click
Add SSH key
- To test that it's working correctly, enter this at the command line:
ssh -T git@github.com
. The response should be a greeting containing your github username.
- In a browser, go to github.com and log in. Then, in the upper-right corner, click your profile picture, then click
Other recommended accounts to set up
Sign up for a Khoury account. After your account is approved, you can access Khoury Admin here.
Sign up for an O'Reilly Learning account for legal access to thousands of high-quality computing books (free to NU students, $49/month otherwise). You will need to click on "Institution not listed?"