2.9 KiB
2.9 KiB
Code Dependencies
This document is about how the outputs and preflights declare their dependencies. Is intended for developers trying to understand how to create plug-ins.
The dependencies are declared as YAML inside the docstring of the module. So they look like some kind of comment.
The YAML code must contain a key named Dependencies with a list of dependencies.
The dep_dowloader.py module contains the core dependencies.
There are two type of dependencies:
- Actual dependencies, they contain a
role - Template dependencies, they are referenced by other dependencies using
from
An example of template:
- name: KiCad Automation tools
github: INTI-CMNB/KiAuto
command: pcbnew_do
pypi: kiauto
downloader: pytool
id: KiAuto
And an example of dependency that uses a template:
- from: KiAuto
role: mandatory
version: 1.6.7
The name is the name shown to the user, the id is the internal name.
Here are the most common attributes:
role: What this dependency is used for. Themandatoryrole means this dependency must be met in order to run the plug-in.command: Name of the executable.version: The minimum version needed.github: The name of the GitHub project hosting it. Useful for tools that can be downloaded using thepythondownloader.url: When page for the tool. The one to visit.url_down: The URL to download the tool. Useful for the downloaders.debian: The name of the Debian package for this dependency.extra_deb: Extra Debian packages needed for this tool. They are usually suggested dependencies that are needed for our use.python_module:truewhen this tool provides a Python module (and no executable). Something weimport.module_name: The name of the Python module. By default we assume this is the same as thename.plugin_dirs: Used for tools that can be installed as a KiCad plug-in. Is a list of directories where the plug-in can be found, they are relative to the KiCad plug-in places.help_option: Used when the tool doesn't implement--version.no_cmd_line_version_old:truewhen old versions of the tool doesn't implement--version.pypi: Name of the tool in PyPi.orgdownloader: The name of a Python function declared indep_downloader.pythat can be used to download the tool.comments: A string or a list of strings containing extra information to show to the user when the tool isn't installed.
Currently we have the following downloaders:
pytool: Can download a Python module from GitHub. After downloading the sources of the last release we runpip install -U .python: Used to install stuff from PyPi. We just runpip install -U PYPI_NAMEgit: Installs Gitconvert: Installs ImageMagickgs: Installs Ghostscriptrsvg: Installs the binary tools from the RSVG libraryrar: Installs RAR
Most downloaders are very limited and poorly tested. They are just a last resort.