Skip to content

Commit 539aefb

Browse files
committed
docs(install): install with Homebrew and a toolchains guide
README and the installation spec add `brew install bkuberek/tap/cstudy` next to uv and pipx, and say which cstudy runs when several are on PATH. docs/guides/toolchains.md gives the recommended install of uv and Python 3.13, Node 24 and pnpm, and JDK 21 on macOS and Linux, each with the command that checks it, matching what cstudy doctor accepts. Kotlin needs no kotlinc: the Kotlin Gradle plugin compiles it. README replaces its prerequisites with a short macOS version that links the guide.
1 parent c56038e commit 539aefb

4 files changed

Lines changed: 161 additions & 14 deletions

File tree

‎README.md‎

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,40 @@ coding-study is a local, IDE-first practice system for senior and staff software
77
- **Optimality, not only correctness.** `cstudy bench` measures how your solution grows with input size and compares it with the reference approaches.
88
- **Spaced repetition.** `cstudy next` brings back what is due and picks new problems from your weakest pattern.
99

10-
## Prerequisites
10+
## Install
1111

12-
uv and Python are required; Node.js and the JDK are needed only for the languages that use them. `cstudy doctor` checks each tool and prints a fix for anything missing.
12+
Install `cstudy` once; the problems, tracks and runners ship with it. With Homebrew:
1313

14-
| Tool | Version | Needed for |
15-
|------|---------|------------|
16-
| [uv](https://docs.astral.sh/uv/) | 0.10 or newer | Required: installs `cstudy` and manages Python |
17-
| Python | 3.13 | Required: install it with `uv python install 3.13` |
18-
| [Node.js](https://nodejs.org/) and [pnpm](https://pnpm.io/) | Node 24 or newer, pnpm 9 or newer | Optional: TypeScript |
19-
| JDK | 21 | Optional: Java and Kotlin (the Gradle wrapper ships with the workspace) |
20-
| git | any | Optional: versioning your workspace |
14+
```bash
15+
brew install bkuberek/tap/cstudy
16+
cstudy --version
17+
```
2118

22-
## Install
19+
Homebrew also installs the Python that `cstudy` runs on. Upgrade with `brew upgrade cstudy`. Each release reaches the tap automatically ([versioning](docs/specs/versioning.md#homebrew-tap)).
2320

24-
Install `cstudy` once; the problems, tracks and runners ship with it.
21+
Or with uv or pipx, from the repository:
2522

2623
```bash
2724
uv tool install git+https://github.com/bkuberek/coding-study
2825
# or: pipx install git+https://github.com/bkuberek/coding-study
29-
cstudy --version
3026
```
3127

32-
Upgrade with `uv tool upgrade coding-study` (or `pipx upgrade coding-study`).
28+
Upgrade with `uv tool upgrade coding-study` (or `pipx upgrade coding-study`). Keep one of these installs: when several exist, the `cstudy` whose directory comes first on `PATH` runs (`which -a cstudy` lists them).
29+
30+
## Install the language toolchains
31+
32+
`cstudy` runs your solutions with the real toolchain of each language, which you install yourself. uv and Python are required; Node.js and the JDK are needed only for the languages that use them. The recommended install on macOS:
33+
34+
| Tool | Version | Needed for | Install on macOS |
35+
|------|---------|------------|------------------|
36+
| [uv](https://docs.astral.sh/uv/) | 0.10 or newer | Required: manages Python and the Python practice project | `brew install uv` |
37+
| Python | 3.13 | Required | `uv python install 3.13` |
38+
| [Node.js](https://nodejs.org/) | 24 or newer | Optional: TypeScript | `brew install fnm`, then `fnm install 24` |
39+
| [pnpm](https://pnpm.io/) | 9 or newer | Optional: TypeScript | `corepack enable pnpm` |
40+
| JDK | 21 exactly | Optional: Java and Kotlin (the workspace's Gradle wrapper downloads Gradle and the Kotlin compiler) | [SDKMAN!](https://sdkman.io): `sdk install java` with a Temurin 21 identifier from `sdk list java` |
41+
| git | any | Optional: versioning your workspace | `xcode-select --install` |
42+
43+
[Install the language toolchains](docs/guides/toolchains.md) has the full steps, Linux, and the check for each. Then run `cstudy doctor`: it checks each tool and prints a fix for anything missing. In a workspace, `cstudy doctor --fix` also sets up the practice projects.
3344

3445
## Quickstart
3546

‎docs/README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ coding-study is a local, IDE-first interview-prep system: original problems stor
2525
| [authoring](specs/authoring.md) | Authoring workflow, `problem.md` and `explanation.md` formats, ready criteria, every `cstudy verify` check | Writing or reviewing a problem |
2626
| [installation-and-workspaces](specs/installation-and-workspaces.md) | Packaging, content and workspace resolution, `cstudy init`, the runner runtime, IDE files, your own problems | Installing `cstudy`, setting up a workspace, or changing where files live |
2727

28+
## Guides
29+
30+
| Guide | Covers | Read when |
31+
|-------|--------|-----------|
32+
| [toolchains](guides/toolchains.md) | Installing and checking uv and Python 3.13, Node.js and pnpm, and JDK 21 on macOS and Linux | Setting up a machine, or when `cstudy doctor` reports a missing toolchain |
33+
2834
## Decisions
2935

3036
| ADR | Decision |

‎docs/guides/toolchains.md‎

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Install the language toolchains
2+
3+
`cstudy` builds and runs your solutions with the real toolchains of each language, and you install those yourself: neither Homebrew nor uv pulls them in with `cstudy`. This guide gives the recommended install on macOS and Linux and the command that checks it. `cstudy doctor` runs the same checks and links back here when one fails.
4+
5+
| Toolchain | Version `cstudy doctor` accepts | Needed for |
6+
|-----------|---------------------------------|------------|
7+
| [uv and Python](#python-and-uv) | uv (any version; 0.10 or newer recommended), Python 3.13 found by `uv python find 3.13` | Required: `cstudy` and the Python practice project |
8+
| [Node.js and pnpm](#nodejs-and-pnpm) | Node 24 or newer, any pnpm (9 or newer recommended) | TypeScript |
9+
| [JDK 21](#jdk-21) | Exactly major version 21 | Java and Kotlin |
10+
| [git](#git) | Any | Optional: versioning your workspace |
11+
12+
You need only the toolchains of the languages you practice. `cstudy doctor` still reports a missing one as `FAIL`, and exits 4, when you do not use that language.
13+
14+
## Python and uv
15+
16+
uv installs Python 3.13 and manages the workspace's Python project (`python/`), whose virtual environment `cstudy doctor --fix` creates with `uv sync`. Install uv with its standalone installer on either system, or with Homebrew on macOS:
17+
18+
```bash
19+
curl -LsSf https://astral.sh/uv/install.sh | sh # macOS and Linux
20+
brew install uv # macOS, alternative
21+
```
22+
23+
`cstudy doctor` looks for Python 3.13 with `uv python find 3.13`, which also finds interpreters on `PATH`, such as the `python@3.13` that the Homebrew formula installs. When it finds none, install one through uv:
24+
25+
```bash
26+
uv python install 3.13
27+
```
28+
29+
Check both:
30+
31+
```bash
32+
uv --version # uv 0.10.0 or newer
33+
uv python find 3.13 # prints the path of a Python 3.13 interpreter
34+
```
35+
36+
The workspace's Python project also lists `debugpy`, which only `cstudy test --debug` needs; `cstudy doctor --fix` installs it with the rest of the project.
37+
38+
## Node.js and pnpm
39+
40+
The TypeScript runner runs your `.ts` files directly with Node's type stripping, which needs Node 24 or newer. pnpm installs the workspace's TypeScript project (`typescript/`). We recommend [fnm](https://github.com/Schniz/fnm) to install Node, and Corepack, which ships with Node 24, to provide pnpm.
41+
42+
1. Install fnm:
43+
44+
```bash
45+
brew install fnm # macOS
46+
curl -fsSL https://fnm.vercel.app/install | bash # Linux
47+
```
48+
49+
2. Load fnm in your shell, by adding this line to `~/.zshrc` (for bash, use `--shell bash` in `~/.bashrc`), then open a new terminal:
50+
51+
```bash
52+
eval "$(fnm env --use-on-cd --shell zsh)"
53+
```
54+
55+
3. Install Node 24 and make it the default:
56+
57+
```bash
58+
fnm install 24
59+
fnm default 24
60+
```
61+
62+
4. Enable pnpm through Corepack. If the `corepack` command is not found, run `npm install --global corepack` first.
63+
64+
```bash
65+
corepack enable pnpm
66+
```
67+
68+
Check both:
69+
70+
```bash
71+
node --version # v24.0.0 or newer
72+
pnpm --version # 9.0.0 or newer
73+
```
74+
75+
nvm (`nvm install 24`) works as well as fnm, and on macOS `brew install node pnpm` installs both without a version manager.
76+
77+
## JDK 21
78+
79+
The Java and Kotlin practice projects build with Gradle against a Java 21 toolchain, and `cstudy doctor` requires `java -version` to report major version 21: JDK 17 and JDK 25 both fail. The vendor does not matter. We recommend [SDKMAN!](https://sdkman.io) on macOS and Linux, with Eclipse Temurin.
80+
81+
1. Install SDKMAN, then open a new terminal:
82+
83+
```bash
84+
curl -s "https://get.sdkman.io" | bash
85+
```
86+
87+
2. List the Java builds and pick a Temurin 21 identifier, the line ending in `-tem` whose version starts with `21.`:
88+
89+
```bash
90+
sdk list java
91+
```
92+
93+
3. Install it and make it the default `java`. The identifier below was current on October 29, 2026; use the one from your list. A plain `sdk install java` installs the newest release (25 or later), which `cstudy doctor` rejects.
94+
95+
```bash
96+
sdk install java 21.0.13.0+9-tem
97+
sdk default java 21.0.13.0+9-tem
98+
```
99+
100+
Check it:
101+
102+
```bash
103+
java -version # openjdk version "21.0.13" ...
104+
```
105+
106+
Nothing else is needed for Java or Kotlin:
107+
108+
- **Gradle**: each workspace ships the Gradle wrapper (`jvm/gradlew`), which downloads its own Gradle on first use. `cstudy doctor` reports a missing system Gradle as `WARN`; only a maintainer who regenerates the wrapper needs one (`brew install gradle`).
109+
- **Kotlin**: the Kotlin Gradle plugin compiles the Kotlin project, and Gradle downloads it with the build, so `kotlinc` is not required. Install it with `sdk install kotlin` only if you want a Kotlin REPL.
110+
111+
Alternatives to SDKMAN: on macOS, `brew install openjdk@21`, then follow its caveats to put it on `PATH`; on Debian and Ubuntu, `sudo apt install openjdk-21-jdk`; on Fedora, `sudo dnf install java-21-openjdk-devel`.
112+
113+
## git
114+
115+
git is optional: `cstudy init --git` runs `git init` in the new workspace, and `cstudy` never commits. macOS provides git with the Xcode Command Line Tools (`xcode-select --install`) or `brew install git`; on Linux, install your distribution's `git` package.
116+
117+
## Check everything
118+
119+
Run `cstudy doctor` to check the toolchains. In a workspace, `cstudy doctor --fix` then sets up each project: `uv sync` in `python/`, `pnpm install` in `typescript/`, and a first Gradle build in `jvm/`.
120+
121+
```bash
122+
cstudy doctor
123+
cd ~/cstudy-workspace && cstudy doctor --fix
124+
```
125+
126+
[cstudy doctor](../specs/cli.md#cstudy-doctor) lists every check and its fix.

‎docs/specs/installation-and-workspaces.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,20 @@
55
## Install
66

77
```bash
8+
brew install bkuberek/tap/cstudy
89
uv tool install git+https://github.com/bkuberek/coding-study
910
pipx install git+https://github.com/bkuberek/coding-study
1011
```
1112

12-
Both build the project at the repository root. A content author works from a checkout instead: `uv run cstudy ...` in the checkout, or `uv tool install --editable .` to put that checkout's `cstudy` on `PATH`.
13+
Homebrew installs a release: its wheel from the GitHub release, into a virtual environment on Homebrew's Python 3.13, with the runtime dependencies pinned in `uv.lock` ([ADR 0013](../decisions/0013-homebrew-distribution.md), [Homebrew tap](versioning.md#homebrew-tap)). uv and pipx build the project at the repository root of the default branch. A content author works from a checkout instead: `uv run cstudy ...` in the checkout, or `uv tool install --editable .` to put that checkout's `cstudy` on `PATH`.
14+
15+
When several installs exist, the first `cstudy` on `PATH` runs; Homebrew warns when an earlier `PATH` entry shadows its `cstudy`. No install method brings the language toolchains: [install the language toolchains](../guides/toolchains.md), then run `cstudy doctor`.
1316

1417
| Item | Rule |
1518
|------|------|
1619
| Distribution | `coding-study`, defined by the root `pyproject.toml` (hatchling); the `cstudy` script |
1720
| Wheel | `coding_study/` from `cli/src/coding_study/`, plus `coding_study/content/{problems,tracks,runners,schemas}` from the repository root |
21+
| Release files | The wheel and `requirements.txt` (the runtime dependencies from `uv.lock`, with hashes), attached to the GitHub release of each version ([versioning](versioning.md#github-release)) |
1822
| sdist | The same top-level paths as the checkout (`cli/src`, `problems`, `tracks`, `runners`, `schemas`), so a wheel built from the sdist equals one built from the checkout |
1923
| Excluded | Build output and caches (`node_modules`, `build`, `.gradle`, `.kotlin`, `.venv`, `__pycache__`, `.pytest_cache`, `.ruff_cache`) and `runners/python/tests` |
2024
| Workspace templates | Package data in `coding_study/adapters/workspace_template/`: the three practice projects with the Gradle wrapper and lock files |

0 commit comments

Comments
 (0)