|
1 | 1 | # Bootstrap for Python coding kata |
2 | 2 |
|
3 | 3 | [](https://github.com/Coding-Cuddles/bootstrap-python-kata/actions/workflows/main.yml) |
| 4 | +[](https://www.python.org/downloads/) |
| 5 | +[](LICENSE) |
4 | 6 |
|
5 | | -## Overview |
6 | | - |
7 | | -This is a bootstrap repository for clean code katas in Python 3 using pytest. |
| 7 | +Start a Python coding kata with pytest. Setup is complete when the starter test passes. |
8 | 8 |
|
9 | 9 | ## Prerequisites |
10 | 10 |
|
11 | | -- [Python 3.8+](https://www.python.org/) |
12 | | -- [pytest](https://pytest.org) |
| 11 | +Required: |
| 12 | + |
| 13 | +- [Git](https://git-scm.com/downloads) |
| 14 | +- [uv](https://docs.astral.sh/uv/getting-started/installation/) |
| 15 | + |
| 16 | +Optional: |
| 17 | + |
| 18 | +- [GNU Make](https://www.gnu.org/software/make/), for shorter commands. Every required task also |
| 19 | + has a direct `uv` command. |
| 20 | + |
| 21 | +You do not need to install Python or pytest separately. `uv` installs a compatible Python version |
| 22 | +and the locked project dependencies when needed. |
| 23 | + |
| 24 | +## Set up the kata |
| 25 | + |
| 26 | +1. Clone the repository: |
| 27 | + |
| 28 | + ```console |
| 29 | + git clone https://github.com/Coding-Cuddles/bootstrap-python-kata.git |
| 30 | + ``` |
| 31 | + |
| 32 | +2. Enter the repository directory: |
| 33 | + |
| 34 | + ```console |
| 35 | + cd bootstrap-python-kata |
| 36 | + ``` |
| 37 | + |
| 38 | +3. Run the starter test. Use Make when it is installed: |
| 39 | + |
| 40 | + ```console |
| 41 | + make test |
| 42 | + ``` |
| 43 | + |
| 44 | + Otherwise, run pytest through `uv` directly: |
| 45 | + |
| 46 | + ```console |
| 47 | + uv run pytest |
| 48 | + ``` |
| 49 | + |
| 50 | + The first run may install Python and the project dependencies. Setup is complete when pytest |
| 51 | + reports `1 passed`. |
| 52 | + |
| 53 | + If the command fails with `uv: command not found`, install |
| 54 | + [uv](https://docs.astral.sh/uv/getting-started/installation/) and repeat this step. |
| 55 | + |
| 56 | +## Work on the kata |
| 57 | + |
| 58 | +1. Replace the starter assertions in `test_something.py` with the first kata test. |
| 59 | + |
| 60 | +2. Run the tests after each change. Use Make when it is installed: |
| 61 | + |
| 62 | + ```console |
| 63 | + make test |
| 64 | + ``` |
| 65 | + |
| 66 | + Otherwise, run pytest through `uv` directly: |
| 67 | + |
| 68 | + ```console |
| 69 | + uv run pytest |
| 70 | + ``` |
| 71 | + |
| 72 | + Continue when the test run passes. |
13 | 73 |
|
14 | | -## Usage |
| 74 | +## Make command reference |
15 | 75 |
|
16 | | -### Run tests |
| 76 | +Make is optional. Run `make` or `make help` to list these commands in the terminal. |
17 | 77 |
|
18 | | -```console |
19 | | -make test |
20 | | -``` |
| 78 | +| Command | Result | |
| 79 | +| ------------------- | --------------------------------------- | |
| 80 | +| `make all` | Run the test suite | |
| 81 | +| `make test` | Run the test suite | |
| 82 | +| `make format` | Format tracked Python files | |
| 83 | +| `make format-check` | Check formatting without changing files | |
| 84 | +| `make clean` | Remove generated caches | |
0 commit comments