Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Thanks for helping! There are two kinds of contribution here.

## 1. Learners: the exercises

- **Lesson 01:** add `first-commits/YOUR-USERNAME.py`. See
[the lesson](lessons/01-first-pr-in-browser/).
- **Lesson 04:** add `practice/greetings/YOUR_NAME.py` and its test. See
[the lesson](lessons/04-second-pr-from-terminal/).
- **Lesson 02:** add `first-commits/YOUR-USERNAME.py`. See
[the lesson](lessons/02-first-pr-in-browser/).
- **Lesson 05:** add `practice/greetings/YOUR_NAME.py` and its test. See
[the lesson](lessons/05-second-pr-from-terminal/).

Bots check and merge these PRs. Change only your own files.

Expand Down
52 changes: 26 additions & 26 deletions CURRICULUM.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
**Goal:** someone who has never opened a pull request finishes able to
contribute to **any** open source project, not just this course's practice
repo. The course ends with a real, merged pull request in a project the
learner chose themselves (Lesson 12).
learner chose themselves (Lesson 13).

## What you can do when you finish

Every item is taught in a lesson and practised in an exercise:

- [ ] Fork, clone, branch, commit, push and open a PR, in the browser or the terminal (01–04)
- [ ] Keep your fork and branch up to date with upstream (02, 09)
- [ ] Read a project's house rules: CONTRIBUTING, CLA or DCO, AI policy, code of conduct (05)
- [ ] Set up an unfamiliar Python project and run its tests and linters, whatever tools it uses: pip, uv, Poetry, Hatch, tox, nox, pre-commit, Make (06)
- [ ] Find an issue that's open, unclaimed and has no existing PR, and claim it properly (07)
- [ ] Make a change the way the project wants: tests, docs, style, changelog entry, commit message (08)
- [ ] Fix a failing CI check, respond to review, apply suggestions, rebase, resolve conflicts, squash on request (09)
- [ ] Use AI tools within a project's policy, and write your own words (05, 10)
- [ ] Handle silence, rejection and "won't fix" gracefully, and know what's different off GitHub (11)
- [ ] Land a merged PR in an external project (12)
- [ ] Fork, clone, branch, commit, push and open a PR, in the browser or the terminal (02–05)
- [ ] Keep your fork and branch up to date with upstream (03, 10)
- [ ] Read a project's house rules: CONTRIBUTING, CLA or DCO, AI policy, code of conduct (06)
- [ ] Set up an unfamiliar Python project and run its tests and linters, whatever tools it uses: pip, uv, Poetry, Hatch, tox, nox, pre-commit, Make (07)
- [ ] Find an issue that's open, unclaimed and has no existing PR, and claim it properly (08)
- [ ] Make a change the way the project wants: tests, docs, style, changelog entry, commit message (09)
- [ ] Fix a failing CI check, respond to review, apply suggestions, rebase, resolve conflicts, squash on request (10)
- [ ] Use AI tools within a project's policy, and write your own words (06, 11)
- [ ] Handle silence, rejection and "won't fix" gracefully, and know what's different off GitHub (12)
- [ ] Land a merged PR in an external project (13)

Every lesson has the same four parts:

Expand All @@ -38,44 +38,44 @@ Each long video also gets one 60-second clip for Shorts/Reels.

| # | Lesson | Hands-on | Status |
|---|---|---|---|
| 00 | [What counts as a contribution](lessons/00-what-counts/) | Pick the kind of contribution you'll make first | Drafted |
| 01 | [Star, fork, and your first commit, in the browser](lessons/01-first-pr-in-browser/) | Add `first-commits/YOU.py` to this repo; the bot merges it | Drafted |
| 01 | [What counts as a contribution](lessons/01-what-counts/) | Pick the kind of contribution you'll make first | Drafted |
| 02 | [Star, fork, and your first commit, in the browser](lessons/02-first-pr-in-browser/) | Add `first-commits/YOU.py` to this repo; the bot merges it | Drafted |

## Part 2: Real tools

| # | Lesson | Hands-on | Status |
|---|---|---|---|
| 02 | [Set up your machine: git, `gh`, Python, a private email](lessons/02-set-up-your-machine/) | Run `tools/doctor.py` until it's all green | Drafted |
| 03 | [Just enough git: commits, branches, merges, remotes](lessons/03-just-enough-git/) | A local sandbox repo | Drafted |
| 04 | [Your second PR, from the terminal: a Python function and its test](lessons/04-second-pr-from-terminal/) | Exercise 2 in `practice/`: pytest + ruff must pass in CI | Drafted |
| 03 | [Set up your machine: git, `gh`, Python, a private email](lessons/03-set-up-your-machine/) | Run `tools/doctor.py` until it's all green | Drafted |
| 04 | [Just enough git: commits, branches, merges, remotes](lessons/04-just-enough-git/) | A local sandbox repo | Drafted |
| 05 | [Your second PR, from the terminal: a Python function and its test](lessons/05-second-pr-from-terminal/) | Exercise 2 in `practice/`: pytest + ruff must pass in CI | Drafted |

## Part 3: Real projects

| # | Lesson | Hands-on | Status |
|---|---|---|---|
| 05 | [House rules: CONTRIBUTING, CLAs, DCO sign-offs, AI policies, code of conduct](lessons/05-house-rules/) | Fill the pre-flight checklist for 3 projects | Drafted |
| 06 | [Setting up any Python project](lessons/06-set-up-any-project/): reading `pyproject.toml`, and the common setups (pip + venv, uv, Poetry, Hatch, tox, nox, pre-commit, Make). Plus docs builds (Sphinx, MkDocs). `tools/which_setup.py` detects them | Clone 2 real projects and get their test suites passing locally | Drafted |
| 07 | [Finding an issue](lessons/07-finding-an-issue/): `good first issue`, checking it's unclaimed, **searching for existing PRs first**, asking to be assigned. `tools/find_issues.py` lists fresh, unclaimed issues in welcoming Python projects | Shortlist 3 issues and comment on one | Drafted |
| 08 | [Making the change](lessons/08-making-the-change/): reproduce first, a failing test, the fix, docs, changelog/news fragments, commit messages. Docs-only PRs and good bug reports count too | Exercise 3 (local): fix a planted bug with a test; `tools/check_exercise_3.py` checks it | Drafted |
| 09 | [CI and review](lessons/09-ci-and-review/): reading red checks, "changes requested", applying suggestions, syncing with upstream, rebasing, merge conflicts, squashing on request | `tools/conflict_lab.py`: rebase, resolve a conflict, answer review, squash | Drafted |
| 06 | [House rules: CONTRIBUTING, CLAs, DCO sign-offs, AI policies, code of conduct](lessons/06-house-rules/) | Fill the pre-flight checklist for 3 projects | Drafted |
| 07 | [Setting up any Python project](lessons/07-set-up-any-project/): reading `pyproject.toml`, and the common setups (pip + venv, uv, Poetry, Hatch, tox, nox, pre-commit, Make). Plus docs builds (Sphinx, MkDocs). `tools/which_setup.py` detects them | Clone 2 real projects and get their test suites passing locally | Drafted |
| 08 | [Finding an issue](lessons/08-finding-an-issue/): `good first issue`, checking it's unclaimed, **searching for existing PRs first**, asking to be assigned. `tools/find_issues.py` lists fresh, unclaimed issues in welcoming Python projects | Shortlist 3 issues and comment on one | Drafted |
| 09 | [Making the change](lessons/09-making-the-change/): reproduce first, a failing test, the fix, docs, changelog/news fragments, commit messages. Docs-only PRs and good bug reports count too | Exercise 3 (local): fix a planted bug with a test; `tools/check_exercise_3.py` checks it | Drafted |
| 10 | [CI and review](lessons/10-ci-and-review/): reading red checks, "changes requested", applying suggestions, syncing with upstream, rebasing, merge conflicts, squashing on request | `tools/conflict_lab.py`: rebase, resolve a conflict, answer review, squash | Drafted |

## Part 4: Being a good contributor

| # | Lesson | Hands-on | Status |
|---|---|---|---|
| 10 | [Using AI tools well](lessons/10-using-ai-well/): where they help and hurt, verifying output, disclosure formats (`--trailer`), writing in your own words | Verify an AI explanation; rewrite an AI-style PR description | Drafted |
| 11 | [After the PR, and beyond GitHub](lessons/11-after-the-pr/): waiting, nudging once, rejection, stale bots, becoming a regular. GitLab, Codeberg, Gerrit and mailing-list patches | Write a nudge and a graceful close; test someone's PR | Drafted |
| 11 | [Using AI tools well](lessons/11-using-ai-well/): where they help and hurt, verifying output, disclosure formats (`--trailer`), writing in your own words | Verify an AI explanation; rewrite an AI-style PR description | Drafted |
| 12 | [After the PR, and beyond GitHub](lessons/12-after-the-pr/): waiting, nudging once, rejection, stale bots, becoming a regular. GitLab, Codeberg, Gerrit and mailing-list patches | Write a nudge and a graceful close; test someone's PR | Drafted |

## Part 5: Capstone

| # | Lesson | Hands-on | Status |
|---|---|---|---|
| 12 | **[Your first external contribution](lessons/12-capstone/)**: a stage-by-stage checklist for a real PR | Get a PR merged in a real project you don't own, then add `graduates/YOUR-USERNAME.py`. The **Validate graduate** bot checks on GitHub that the PR is merged, yours, merged by a maintainer and in a real project, then you join the [graduates wall](graduates/) | Drafted |
| 13 | **[Your first external contribution](lessons/13-capstone/)**: a stage-by-stage checklist for a real PR | Get a PR merged in a real project you don't own, then add `graduates/YOUR-USERNAME.py`. The **Validate graduate** bot checks on GitHub that the PR is merged, yours, merged by a maintainer and in a real project, then you join the [graduates wall](graduates/) | Drafted |
| A | [Troubleshooting](lessons/A-troubleshooting/): login problems, pushing to the wrong repo, committed to `main`, push rejected, detached HEAD, fixing your last commit, fork out of date, pip and venv errors, PRs in the wrong place | A sandbox to break and fix each problem | Drafted |

## Principles

1. **A win in the first 15 minutes.** Lesson 01 needs no install, only a
1. **A win in the first 15 minutes.** Lesson 02 needs no install, only a
GitHub account.
2. **Teach what real Python projects actually check.** Later lessons are
built around the checks a maintainer will run (pytest, ruff, pre-commit,
Expand All @@ -84,6 +84,6 @@ Each long video also gets one 60-second clip for Shorts/Reels.
account is run in CI (`tools/test_commands.py`), so the course can't go
out of date without us noticing. The rest are marked and explained.
4. **Honest about AI.** The course is AI-generated and human-reviewed, and
says so. Lessons 05 and 10 ask learners to be just as honest.
says so. Lessons 06 and 11 ask learners to be just as honest.
5. **Real projects, not just practice.** The sandbox teaches the moves.
The capstone is only complete with a merged PR somewhere else.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A free video course that takes you from "I've never opened a pull request"
to a merged contribution to a real Python project.

- **Lesson 01 needs no install.** You open your first pull request in the
- **Lesson 02 needs no install.** You open your first pull request in the
browser and a bot merges it within minutes.
- **Then the real tools:** git, GitHub CLI, virtualenvs, pytest, ruff,
pre-commit — the things maintainers will actually check.
Expand All @@ -14,7 +14,7 @@ to a merged contribution to a real Python project.

👉 Start with [the curriculum](CURRICULUM.md).

The hands-on exercises happen right here: in Lesson 01 you star and fork
The hands-on exercises happen right here: in Lesson 02 you star and fork
this repo, then add your own file to [`first-commits/`](first-commits/) as
your first commit. A bot checks it and merges it.

Expand All @@ -32,7 +32,7 @@ re-rendering. If you spot something wrong, please

```
lessons/NN-slug/ README.md, script.md, exercise.md, quiz.md
first-commits/ one file per learner, added in Lesson 01
first-commits/ one file per learner, added in Lesson 02
tools/ lesson checker, video renderer (Python)
tests/ tests for the tools and lesson structure
publishing/ Udemy landing page copy (tools/udemy_package.py builds dist/udemy/)
Expand All @@ -43,7 +43,7 @@ publishing/ Udemy landing page copy (tools/udemy_package.py builds dist/u
```bash
uv run pytest # check lesson structure and tools
uv run ruff check . # lint
uv run python tools/render_video.py lessons/00-what-counts # render a video
uv run python tools/render_video.py lessons/01-what-counts # render a video
```

## License
Expand Down
2 changes: 1 addition & 1 deletion first-commits/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# First commits

Everyone who finishes [Lesson 01](../lessons/01-first-pr-in-browser/) has a
Everyone who finishes [Lesson 02](../lessons/02-first-pr-in-browser/) has a
file in this folder. Add yours as `first-commits/YOUR-USERNAME.py`:

```python
Expand Down
2 changes: 1 addition & 1 deletion graduates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Everyone here finished [the course](../CURRICULUM.md) and got a pull request
merged in a real open source project. See
[Lesson 12](../lessons/12-capstone/) to join them.
[Lesson 13](../lessons/13-capstone/) to join them.

This page is generated by `tools/graduates_wall.py`. Don't edit it by hand.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Lesson 00: What counts as a contribution
# Lesson 01: What counts as a contribution

**Time:** 4 minute video · 5 minute exercise
**You'll need:** nothing yet
Expand Down Expand Up @@ -59,4 +59,4 @@ what this course teaches.
handling review.
4. **Part 4:** being a good contributor, including using AI tools honestly.

Next: [Lesson 01: your first PR, entirely in the browser](../01-first-pr-in-browser/).
Next: [Lesson 02: your first PR, entirely in the browser](../02-first-pr-in-browser/).
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
authentication). Many projects require it for contributors.
3. **Pick your first target.** Write down which contribution from the table
in this lesson you'd like to make first in a real project. You'll come
back to it in Lesson 07.
back to it in Lesson 08.

Done? Go to [Lesson 01](../01-first-pr-in-browser/).
Done? Go to [Lesson 02](../02-first-pr-in-browser/).
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,4 @@ bullets:
> Turn on two factor authentication. Many projects require it.

> And look at the list of contributions again. Write down the one you'd like
> to make first. Then open lesson one. Your first pull request is waiting.
> to make first. Then open lesson two. Your first pull request is waiting.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Lesson 01: Star, fork, and your first commit, in the browser
# Lesson 02: Star, fork, and your first commit, in the browser

**Time:** 3 minute video · 10 minute exercise
**You'll need:** a GitHub account. Nothing to install.
Expand Down Expand Up @@ -93,4 +93,4 @@ will do both in Part 3.
| Isn't valid Python | Usually a missing quote. Each value needs `"` at both ends. |
| `github` doesn't match | The `github = "..."` value must be your username. |

Next: [Lesson 02: set up your machine](../02-set-up-your-machine/).
Next: [Lesson 03: set up your machine](../03-set-up-your-machine/).
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Lesson 02: Set up your machine
# Lesson 03: Set up your machine

**Time:** 3 minute video · 20–30 minute exercise (mostly installers)
**You'll need:** the fork you made in Lesson 01
**You'll need:** the fork you made in Lesson 02

In Lesson 01 you did everything in the browser. Real projects need you to
In Lesson 02 you did everything in the browser. Real projects need you to
run their code and tests on your own computer, so now you install the three
tools every Python contributor uses:

Expand Down Expand Up @@ -86,7 +86,7 @@ gh auth status

## Step 5: Clone your fork

In Lesson 01 you forked the course repo on GitHub. Now download your fork
In Lesson 02 you forked the course repo on GitHub. Now download your fork
(replace `YOUR-USERNAME`):

```bash norun
Expand All @@ -109,7 +109,7 @@ upstream https://github.com/thejesh23/first-python-contribution.git (push)

gh adds `upstream` for you because it knows your repo is a fork.

> **Skipped Lesson 01?** Run `gh repo fork thejesh23/first-python-contribution --clone`
> **Skipped Lesson 02?** Run `gh repo fork thejesh23/first-python-contribution --clone`
> instead. It forks and clones in one go.

## Step 6: Get the latest changes, then run the doctor
Expand All @@ -134,9 +134,9 @@ Each line should be a green ✔:
✔ gh is logged in as ada
✔ origin is your fork, upstream is the course repo

All set. You're ready for Lesson 03.
All set. You're ready for Lesson 04.
```

A red ✘ tells you what to fix. Fix the first one and run it again.

Next: [Lesson 03: just enough git](../03-just-enough-git/).
Next: [Lesson 04: just enough git](../04-just-enough-git/).
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Exercise 02: A green doctor

- [ ] Install git, gh and Python 3.10+ (Lesson 02, step 1)
- [ ] Install git, gh and Python 3.10+ (Lesson 03, step 1)
- [ ] Turn on **Keep my email addresses private** on GitHub and copy your noreply address
- [ ] Set `user.name`, `user.email` and `init.defaultBranch` with `git config --global`
- [ ] `gh auth login`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ $ python3 tools/doctor.py
✔ gh is logged in as ada
✔ origin is your fork, upstream is the course repo

All set. You're ready for Lesson 03.
All set. You're ready for Lesson 04.
```

> Last step. Other learners' commits have landed since you forked. So pull
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Lesson 03: Just enough git
# Lesson 04: Just enough git

**Time:** 3 minute video · 15 minute exercise
**You'll need:** git set up (Lesson 02)
**You'll need:** git set up (Lesson 03)

You don't need to know all of git to contribute. You need six ideas. We'll
try each one in a throwaway **sandbox** folder, so nothing can go wrong.
Expand Down Expand Up @@ -111,7 +111,7 @@ Because `main` hadn't changed since `shout` branched off, git just moves

In real projects you rarely merge into `main` yourself. You push a branch and
open a pull request, and the **maintainer** merges it. That's exactly what
happened to your first commit in Lesson 01.
happened to your first commit in Lesson 02.

## 6. Remotes

Expand All @@ -121,7 +121,7 @@ Your sandbox has no remotes:
git remote -v
```

It prints nothing. Your clone of the course repo has two (from Lesson 02):
It prints nothing. Your clone of the course repo has two (from Lesson 03):

```text
upstream (thejesh23/first-python-contribution) ← you pull from here
Expand Down Expand Up @@ -153,4 +153,4 @@ cd ..
rm -rf git-sandbox
```

Next: [Lesson 04: your second PR, from the terminal](../04-second-pr-from-terminal/).
Next: [Lesson 05: your second PR, from the terminal](../05-second-pr-from-terminal/).
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Then, without looking:
**merge commit** or, if both branches changed the same line, reports a
**merge conflict**. If you get a conflict, open `hello.py`, keep the line
you want, delete the `<<<<<<<`, `=======` and `>>>>>>>` markers, then run
`git add hello.py` and `git commit`. You'll meet conflicts again in Lesson 09.
`git add hello.py` and `git commit`. You'll meet conflicts again in Lesson 10.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ $ git log --oneline --graph --all

> In real projects, you rarely merge into main yourself. You push a branch,
> and open a pull request. The maintainer merges it. That is exactly what
> happened to your first commit, in lesson one.
> happened to your first commit, in lesson two.

## Scene 9: Remotes
visual: slide
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Lesson 04: Your second PR, from the terminal
# Lesson 05: Your second PR, from the terminal

**Time:** 6 minute video · 30 minute exercise
**You'll need:** a green `tools/doctor.py` (Lesson 02)
**You'll need:** a green `tools/doctor.py` (Lesson 03)

This time you'll contribute like you would to a real Python project: on a
branch, from the terminal, with **code and a test**, checked by CI before
Expand Down Expand Up @@ -231,4 +231,4 @@ git branch -d exercise-2

`main` now includes your merged work, so the `exercise-2` branch can go.

Next: Lesson 05, the house rules every project expects you to read first.
Next: Lesson 06, the house rules every project expects you to read first.
Original file line number Diff line number Diff line change
Expand Up @@ -442,5 +442,5 @@ bullets:
> That is the real workflow. Branch, test, code, format, lint, push, pull
> request, {CI|C I}, merge. Real Python contributors do this every day.

> Next is lesson five. The house rules that every project expects you to
> Next is lesson six. The house rules that every project expects you to
> read first.
Loading
Loading