Development Setup
If you want to contribute to KiLM or work with the source code, follow these steps to set up a development environment.
1. Clone the Repository
First, clone the KiLM repository from GitHub:
git clone https://github.com/barisgit/kilm.gitcd kilm
2. Create a Virtual Environment (Recommended)
It’s highly recommended to use a virtual environment to isolate development dependencies.
# Using Python's built-in venvpython -m venv .venvsource .venv/bin/activate # On Windows use `.venv\Scripts\activate`
3. Install Dependencies
Install KiLM in editable mode (-e
) along with its development dependencies ([dev]
):
pip install -e ".[dev]"
This installs the package such that changes you make to the source code are immediately reflected when you run the kilm
command (within the activated virtual environment).
The [dev]
part installs extra packages needed for testing and formatting, such as pytest
and black
.
4. Verify Installation
You should now be able to run the development version:
kilm --version
Running Tests
KiLM uses pytest
for testing.
# Run all testspytest
# Run tests in a specific filepytest tests/test_config_commands.py
# Run tests with coverage reportingpytest --cov=kicad_lib_manager --cov-report=term-missing
Code Formatting
KiLM uses Black for code formatting. Ensure your code is formatted before committing:
# Check formattingblack --check .
# Apply formattingblack .
Next Steps
Now you’re ready to start developing! See the Contributing guide for how to submit your changes.