Install custom dependencies
SkillFlaw provides optional dependency groups and support for custom dependencies to extend SkillFlaw functionality. This guide covers how to add dependencies for different SkillFlaw installations, including SkillFlaw Desktop and SkillFlaw OSS.
The SkillFlaw codebase uses two pyproject.toml files to manage dependencies, with one for base and one for main:
- The
mainpackage is managed by the root levelpyproject.toml, and it includes end-user features and main application code, such as Langchain and OpenAI. - The
basepackage is managed atsrc/backend/base/pyproject.toml, and it includes core infrastructure, such as the FastAPI web framework.
Install custom dependencies in SkillFlaw Desktop
To add dependencies to SkillFlaw Desktop, add an entry for the package to the desktop runtime's managed requirements.txt file.
The packaged desktop runtime is distributed separately from the source workspace, so the exact application-data path is package-specific and isn't defined by the Python server code itself.
Use the desktop app's managed data directory for your installation, locate its requirements.txt, and edit that file directly.
Add each dependency to requirements.txt on its own line in the format DEPENDENCY==VERSION, such as matplotlib==3.10.0.
Restart SkillFlaw Desktop to install the dependencies.
If you need to change or uninstall custom dependencies, edit the requirements.txt file, and then restart SkillFlaw Desktop.
Install custom dependencies in SkillFlaw OSS
To install your own custom dependencies in your SkillFlaw environment, add them with your package manager.
If you're working from a SkillFlaw source checkout, add dependencies with uv add because there is already a pyproject.toml file for uv to reference:
_10uv add DEPENDENCY
Install optional dependency groups
SkillFlaw OSS provides optional dependency groups that extend its functionality.
These dependencies are listed in the pyproject.toml file under [project.optional-dependencies].
Install dependency groups using pip's [extras] syntax. For example, to install SkillFlaw with the postgresql dependency group, enter the following command:
_10uv pip install "skillflaw[postgresql]"
To install multiple extras, use commas to separate each dependency group:
_10uv pip install "skillflaw[local,postgresql]"
Use a virtual environment to test custom dependencies
When testing locally, use a virtual environment to isolate your dependencies and prevent conflicts with other Python projects.
For example, if you want to experiment with matplotlib with SkillFlaw:
_10# Create and activate a virtual environment_10uv venv YOUR_SKILLFLAW_VENV_10source YOUR_SKILLFLAW_VENV/bin/activate_10_10# Install SkillFlaw and your additional dependency_10uv pip install skillflaw matplotlib
If you're working from a SkillFlaw source checkout, add dependencies with uv add to reference the existing pyproject.toml files:
_10uv add matplotlib
The uv add commands automatically update the uv.lock file in the appropriate location.
Add dependencies to the SkillFlaw codebase
When contributing to the SkillFlaw codebase, you might need to add dependencies to SkillFlaw.
SkillFlaw uses a workspace with two packages, each with different types of dependencies.
To add a dependency to the main package, run uv add DEPENDENCY from the project root.
For example:
_10uv add matplotlib
Dependencies can be added to the main package as regular dependencies at [project.dependencies] or optional dependencies at [project.optional-dependencies].
To add a dependency to the base package, navigate to src/backend/base and run:
_10cd src/backend/base && uv add DEPENDENCY
To add a development dependency for testing, linting, or debugging, navigate to src/backend/base and run:
_10cd src/backend/base && uv add --group dev DEPENDENCY
Dependencies can be added to the base package as regular dependencies at [project.dependencies], development dependencies at [dependency-groups.dev], or optional dependencies at [project.optional-dependencies].
You can optionally use make add instead of uv add:
_10# Equivalent to: uv add matplotlib_10make add main="matplotlib"_10_10# Equivalent to: cd src/backend/base && uv add --group dev matplotlib_10make add devel="matplotlib"_10_10# Equivalent to: cd src/backend/base && uv add matplotlib_10make add base="matplotlib"
Alternatively, you can add these dependencies manually to the appropriate pyproject.toml file:
_10[project]_10dependencies = [_10 "matplotlib>=3.8.0"_10]
Or as an optional dependency in the main package:
_10[project.optional-dependencies]_10plotting = [_10 "matplotlib>=3.8.0",_10]
Or as a development dependency in the base package:
_10[dependency-groups]_10dev = [_10 "matplotlib>=3.8.0",_10]