Week 1: Getting Started
Goals
- Set up a modern development environment
- Understand how to work on the command-line
- Learn about the
uvpackage managers- Learn our pull request workflow using
git- Make your first pull request (and deal with a merge conflict!)
- Complete ethics training
Sam drafted these pages super quickly, so there are probably lots of details that he left out! Feel free to send a pull request for any page of these guides.
Development Environment
This is just one recommended setup, feel free to customize as much as you’d like.
- For Windows users: Install WSL and Ubuntu, super important! Lots of web dev stuff breaks on non-WSL environments.
- Install an IDE: VSCode / Cursor
- Github Copilot is free for students, be sure to use!
- Install these extensions for VSCode:
- https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff
- https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
- After installing extensions and setting them up, you should be able to paste this code into a Python file and watch it auto-format when you save: https://gist.github.com/SamLau95/09f4bf2bb52824a5c34733d5b6478f77. Then, paste this code into a JS file and watch it auto-format as well! https://gist.github.com/SamLau95/d14f73f82b9322a62f56feced1d4a442
- Optional: Install a feature-rich terminal app: iTerm2 / Ghostty
macOS-specific:
- Install
brewfor CLI tools
Watch a tutorial on using VSCode productively, e.g.: https://youtu.be/ifTF3ags0XI?si=MDWD-K34sOrKuaVk.
Follow this guide to set up VSCode / Cursor for Python development: https://medium.com/ordinaryindustries/the-ultimate-vs-code-setup-for-python-538026b34d94
Now, check your knowledge:
- What is the difference between Cmd+Shift+P and Cmd+P in VSCode?
- What do
brew(macOS) orapt-get(WSL/Linux) do? What is different about these tools vs. downloading and installing an app on your laptop?- What are pros and cons of using a GUI like VSCode over a command-line editor like
nanoorvim?
Working on the Command-Line
Walk through each of these lessons of the Missing Semester. Complete the exercises.
- https://missing.csail.mit.edu/2020/course-shell/
- https://missing.csail.mit.edu/2020/shell-tools/
- https://missing.csail.mit.edu/2020/command-line/
- https://missing.csail.mit.edu/2020/version-control/
- https://missing.csail.mit.edu/2020/potpourri/ (No exercises for this one.)
Optional, but recommended: install and set up fish as your default shell instead of bash.
Rationale:
- https://jvns.ca/blog/2017/04/23/the-fish-shell-is-awesome/
- https://jvns.ca/blog/2024/09/12/reasons-i--still--love-fish/
Now, check your knowledge:
- What do
~,., and..mean in paths? What is the difference between an absolute path and a relative path?- What does the
$PATHenvironment variable control? How would you add a directory to it for just this session vs. permanently?- What is the difference between
>,>>,|, and2>?- What is the difference between stopping a program with
Ctrl-Cand suspending it withCtrl-Z? How do you resume a suspended job in the foreground and in the background?- What does the permission string
-rwxr-x---mean? How do you make a script executable and run it from the current directory?- In
git, what is the difference between the working directory, the staging area, and a commit? What is the difference betweengit commitandgit push?- How can you quickly search your command history? What does
historydo and how do you trigger reverse search?
uv
- install
uv: https://docs.astral.sh/uv/ - we will strongly prefer using
uvoverpipandcondawhere possible. - rationale: https://emily.space/posts/251023-uv
- more advanced rationale: https://www.bitecode.dev/p/a-year-of-uv-pros-cons-and-should
Now, check your knowledge:
- In one sentence, why do we prefer
uvoverpip?- What does a lockfile provide, and where does
uvwrite it in a project?- How do you add a runtime dependency vs. a dev dependency with
uv?- How do you run a module or script through
uvwithout activating the venv?- How do you activate the venv? What does activating the venv do?
- Start a new
uvproject targeting Python3.13. Addjupyterlabandbabypandas==1.0.0.dev1. Launch JupyterLab, create a notebook,import babypandas as bpd, build a tiny DataFrame (e.g., names and ages), sort it by age, and confirm it works.
git workflow: making pull requests
- We will avoid pushing to the
mainbranch of our GitHub! - rationale: https://www.reddit.com/r/explainlikeimfive/comments/1kob5xw/eli5_why_is_pushing_to_a_main_branch_bad_what_is/
- Sam will ask the PLs to prevent direct pushes to the main branch
- read the GitHub flow workflow: https://docs.github.com/en/get-started/using-github/github-flow
Now, check your knowledge:
- Clone our lab webpage https://github.com/dstl-lab/dstl-lab.github.io
- Run the lab webpage locally by following the instructions in the repo README.
- Checkout to a new branch with your name in the branch name (e.g. Sam would create a branch like
sam-add-picture).- Add your name and picture to the lab homepage. Make sure your picture loads locally.
- Commit, then make a pull request to our homepage repo.
- Request a code review from someone else on your team.
- When the other person approves the PR, merge the PR.
- Verify that the build works correctly, then see your updated picture at https://dstl.ucsd.edu/!
CITI training
As research who work with human subjects, we are required to do ethics training.
Go to: https://about.citiprogram.org/
- Create a login using your main @ucsd address (not an alias)
-
This is how campus tracks compliance
- Add University of California, San Diego as your institution
Add a course
- Check boxes Human Subjects Research and Responsible Conduct of Research
- Check boxes Social & Behavioral Research Investigators and Social & Behavioral Research Investigators Refresher
- Check single radial button Social and Behavioral Responsible Conduct of Research Course
- Check none at this time for webinars
You should be assigned
- Social & Behavioral Research - Basic/Refresher
- Social and Behavioral Responsible Conduct of Research
- Complete and add certificate (not completion report) URL to our lab roster