Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 2 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 (4 months ago)
- Default Branch: main
- Last Pushed: 2024-11-20T13:16:00.000Z (3 months ago)
- Last Synced: 2024-11-20T14:23:57.768Z (3 months ago)
- Topics: katas, refactoring, tdd
- Language: Python
- Homepage:
- Size: 605 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 pdm as package manager and python 3.12.
> Those katas that need extra or different configurations will have its specific instructions in the README file.[![Python](https://img.shields.io/badge/Python-3.12+-yellow?style=for-the-badge&logo=python&logoColor=white&labelColor=101010)](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 pdm
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 global 3.12
```
4. Install the dependencies:
```bash
pip install pdm
pdm install
```## Running the tests
To run the tests, execute one of the following commands:
```bash
pytest
```or
```bash
pdm run pytest tests/kata_name
```> [!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 🚀
[![Web](https://img.shields.io/badge/GitHub-Dimanu.py-14a1f0?style=for-the-badge&logo=github&logoColor=white&labelColor=101010)](https://github.com/dimanu-py)