Title: Lab 9 — Three Ways to Build the Same Project
Course: AIINFRA 100: AI Systems & Development Environments > Section: Week 09 — Environment & Package Management: venv, conda, uv

🛠️ Lab 9 — Three Ways to Build the Same Project (50 pts)

Goal: Build the exact same tiny Python project three separate times — once with venv + pip, once with conda, and once with uv — so you can directly compare the workflows, the reproducibility files each one produces, and the install speed. Steps:

1. Create a project folder called joke-of-the-day with three subfolders inside it: attempt-venv, attempt-conda, and attempt-uv.
2. Attempt 1 — venv + pip: Inside attempt-venv, run python -m venv .venv, then activate it. Run pip install requests rich. Create a file joke.py that uses requests to call a free joke API (e.g., a public joke API of your choice) and uses rich to print the joke nicely formatted to the terminal. Run it to confirm it works.
3. Freeze your environment: run pip freeze > requirements.txt inside attempt-venv. Open the file and note how many packages are listed (including dependencies you didn't install directly).
4. Attempt 2 — conda: Install Miniconda (free) if you don't already have conda. Inside attempt-conda, run conda create -n joke-env python=3.11, activate it with conda activate joke-env, then conda install requests rich (or pip install inside the conda environment if a package isn't on conda channels). Copy the same joke.py script in and confirm it runs.
5. Export your conda environment: run conda env export > environment.yml inside attempt-conda. Open the file and compare its structure to requirements.txt.
6. Attempt 3 — uv: Install uv (free, one command per the uv "first steps" docs). Inside attempt-uv, run uv init, then uv add requests rich. Copy the same joke.py script in and run it with uv run joke.py. Notice that uv.lock and pyproject.toml were created automatically — you never had to manually create or activate an environment.
7. Prove reproducibility: Pick ONE of your three attempts. Delete its environment folder (.venv or the conda env) entirely. Recreate it using ONLY the snapshot file (pip install -r requirements.txt, conda env create -f environment.yml, or uv sync) and confirm joke.py still runs correctly.
8. Time it: Using your terminal's timing (or just a stopwatch), roughly time how long the install step took in each of the three attempts. Record the three numbers.
9. Write a short reflection (150–250 words) comparing the three workflows: which felt easiest, which produced the clearest reproducibility file, and what you observed about install speed.

Deliverables: Submit (a) your joke.py script, (b) all three snapshot files (requirements.txt, environment.yml, uv.lock/pyproject.toml), (c) your three rough install-time measurements, and (d) your written reflection — as an upload or pasted into the text entry box.