-
Notifications
You must be signed in to change notification settings - Fork 0
development
WizeDispatcher is an open‑source project. Contributions are welcome! This section outlines how to set up a development environment, run tests, and understand the code structure.
-
Clone the repository:
git clone https://github.com/kairos-xx/wizedispatcher.git cd wizedispatcher -
Create a virtual environment and install dependencies:
python3 -m venv .venv source .venv/bin/activate pip install -r requirements-dev.txt pip install -e .
-
Install development tools such as black, flake8, and mypy.
The repository includes a test suite under the tests directory.
To run the tests:
pytestEnsure that all tests pass before submitting a pull request.
The core of the library is located in wizedispatcher/core.py. It
defines the TypeMatch and WizeDispatcher classes, along with
helper functions and classes. The global dispatch instance is
created in wizedispatcher/__init__.py.
Registries are built on demand when you access @dispatch.name
for the first time, and overloads are collected during class
construction using a descriptor.
If you need to customize the matching algorithm or support new
typing constructs, consider extending or overriding TypeMatch.
You can subclass WizeDispatcher and provide your own version
of _resolve_hints or type_specificity_score. Then instantiate
your custom builder and use it instead of the global dispatch.
Please open an issue or discuss your proposed changes before making major modifications.
- Use black for formatting (run
black .before committing). - Ensure docstrings follow Google style and wrap at 79 characters.
- Add tests for any new features or bug fixes.
- Update the documentation when you change the API.