https://github.com/dimanu-py/python-code-katas
Definition and solution for Python Katas
https://github.com/dimanu-py/python-code-katas
katas refactoring tdd
Last synced: 3 months ago
JSON representation
Definition and solution for Python Katas
- Host: GitHub
- URL: https://github.com/dimanu-py/python-code-katas
- Owner: dimanu-py
- Created: 2024-10-19T20:08:21.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-01-30T07:07:26.000Z (5 months ago)
- Last Synced: 2025-02-13T21:47:18.486Z (5 months ago)
- Topics: katas, refactoring, tdd
- Language: Python
- Homepage:
- Size: 616 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# :snake: Python Code Katas :snake:
> [!NOTE]
> All the code katas are solved using Python. Most of the katas are configured in a similar way, using uv as package manager and python 3.12.
> Those katas that need extra or different configurations will have its specific instructions in the README file.[](https://python.org)
## Standard Configuration
The project can be configured either by using `pip` or `pyenv`. Both ways will be explained.
Using pip
1. Create a virtual environment:
```bash
python -m venv .venv
```
2. Activate the virtual environment:
```bash
source .venv/bin/activate # Linux / Mac
.venv\Scripts\activate # Windows
```
3. Install the dependencies:
```bash
pip install -r requirements.txt
```Using pyenv and uv
These instructions are extracted from pyenv documentation. You can find everything [here](https://github.com/pyenv/pyenv?tab=readme-ov-file)
1. Install pyenv:
```bash
curl https://pyenv.run | bash
```
2. Set you bash profile to load pyenv. In my case I use fish:```bash
set -Ux PYENV_ROOT $HOME/.pyenv
fish_add_path $PYENV_ROOT/bin
echo pyenv init - | source >> ~/.config/fish/config.fish
```
3. Select the python version you want to use:
```bash
pyenv install 3.12
pyenv local 3.12
```4. Install the dependencies:
```bash
pip install uv
uv sync --all-groups
```## Running the tests
To run the tests, execute one of the following commands:
```bash
pytest
```or
```bash
uv run pytest kata_name/tests
```> [!NOTE]
> I tend to use a Makefile to store the most common commands. You can check the Makefile in the root of the project.## Katas
- [x] [FizzBuzz](fizz_buzz/README.md)
- [x] [Leap Year](leap_year/README.md)
- [x] [Gilded Rose Refactoring](gilded_rose/README.md)
- [x] [Parallel Change Refactoring](parallel_change/README.md)
- [x] [Tire Pressure](tire_pressure/README.md)
- [x] [Tell Don't Ask](tell_dont_ask/README.md)
- [ ] [Character Copier](character_copier/README.md)
- [ ] [Bags](bags/README.md)
- [ ] [ATM Machine](atm/README.md)
- [x] [Trip Service](trip_service/README.md)
- [x] [Tic Tac Toe](tic_tac_toe/README.md)
- [ ] [Ohce](ohce/README.md)## Visit my GitHub profile for more projects 🚀
[](https://github.com/dimanu-py)