Germinette is a modern, lightweight Python testing tool designed to automate the evaluation of 42 school Python projects. Inspired by tools like output-matching testers, Germinette helps you verify your exercises with robust checks, clear feedback, and a touch of style.
- Auto-Detection: Automatically identifies which module to test based on your file structure.
- Strict Testing:
- Logic: Runs multiple test cases (standard inputs, edge cases, type checks).
- Style (New): Enforces
flake8compliance. If style fails, testing stops immediately ("Single KO Policy") to prevent confusion. - Execution: Verifies that your scripts run exactly as shown in the subject PDF examples.
- Docstrings: Enforces docstrings on all classes and methods (Strict policy for Module 01).
- Maintenance:
- Auto-Cleanup: Automatically wipes
__pycache__directories after every run to keep your workspace pristine.
- Auto-Cleanup: Automatically wipes
- Detailed Error Reporting:
- Silent Checks: Style checks run quietly.
- Final Report: All errors (logic and style) are consolidated in a detailed report at the end.
- Context: Input context provided for every failure (know exactly what input broke your code).
- Global Updater:
germinette -uworks from anywhere, automatically finding and updating your local Germinette repository. - Rich Output: Beautiful, color-coded terminal output using the
richlibrary. - Recursion & Depth Checks: Detects infinite recursion or stack overflows.
| Module | Status | Features |
|---|---|---|
| Module 00 | π’ Ready | Basic Python, Functions, I/O |
| Module 01 | π’ Ready | Classes, Objects, Strict Docstrings |
| Module 02 | π’ Ready | Error Handling, Custom Exceptions |
| Module 03 | π’ Ready | sys.argv, Data Structures, Generators |
| Module 04 | π’ Ready | File Manipulation, Context Managers, Stdin/out |
| Module 05 | π’ Ready | Polymorphism, ABCs, Protocols |
| Module 06 | π’ Ready | Advanced Imports, Package Structure, Circular Dependencies |
| Module 07 | π’ Ready | Python's Magic, Decorators, Inner Functions |
| Module 08 | π’ Ready | The Life of Data, Typing |
| Module 09 | π’ Ready | The Validation, Decorators Pattern |
| Module 10 | π’ Ready | Functional Power, Functools, Itertools |
Getting germinette running is easy!
- Python 3.10 or higher (Installed by default on 42 machines)
Open your terminal and run these commands:
# 1. Clone the repository
git clone https://github.com/ExceptedPrism3/germinette.git
cd germinette
# 2. Run the install script
./install.shThat's it! The script will install Germinette and automatically configure your PATH (so you can run the command from anywhere).
If you encounter "externally-managed-environment" errors or prefer isolation, use:
./install.sh --homeThis creates a local ecosystem (.germinenv) and symlinks the binary, keeping your system Python clean.
If installation fails, please open an issue on GitHub.
To update Germinette later, simply run this command from anywhere:
germinette -uGerminette now remembers where you installed it, so it will automatically pull the latest changes and reinstall itself.
Navigate to your exercise directory and run:
germinetteOr test a specific module/exercise:
germinette python_module_01
germinette -e "Exercise 2"To remove Germinette completely:
./uninstall.shThis will remove the package and clean up your configuration.
Navigate to your project folder (where your ex00, ex01 folders are) and run:
germinetteIt will automatically detect which module you are working on (e.g., python_module_00 or python_module_01 etc...) and run the tests.
If auto-detection is confused, or you want to be explicit:
germinette python_module_00or
germinette python_module_01Different 42 projects have different strict naming conventions. Germinette enforces the conventions specified in the subject PDF for each module.
For Module 00 and Module 01, the subject explicitly requires:
python_module_00/
βββ ex0/
β βββ ft_hello_garden.py
...
- Use
ex0,ex1, etc. (Notex00). - Always check your subject PDF! If a future module requires
ex00, Germinette will be updated to enforce that specific rule for that module.
Found a bug? The tester saying "KO" when it should be "OK"?
- Check the Subject: 42 subjects are tricky. Double-check the PDF requirements.
- Open an Issue: Please verify your folder structure key-by-key, then open an issue on this repository with:
- Your OS (Mac/Ubuntu)
- The module and exercise
- The error output
We welcome contributions! If you want to add support for missing modules, or fix a bug:
π Read the Contribution Guide for step-by-step instructions!
- Fork the repo.
- Create a branch for your feature (
git checkout -b feature/project_name). - Implement the tester following the guide.
- Submit a Pull Request!
Your project should look something like this for auto-detection to work best:
python_module_00/
βββ ex0/
β βββ ft_hello_garden.py
βββ ex1/
β βββ ft_plot_area.py
...
This project is licensed under the MIT License - see the LICENSE file for details.