Building your local environment
Creating a Virtual Environment for Splink¶
Managing Dependencies with Poetry¶
Splink utilises poetry
for managing its core dependencies, offering a clean and effective solution for tracking and resolving any ensuing package and version conflicts.
You can find a list of Splink's core dependencies within the pyproject.toml file.
Fundamental Commands in Poetry¶
Below are some useful commands to help in the maintenance and upkeep of the pyproject.toml file.
Adding Packages - To incorporate a new package into Splink:
poetry add <package-name>
poetry add <package-name>==<version>
# Add quotes if you want to use other equality calls
poetry add "<package-name> >= <version>"
Modifying Packages - To remove a package from the project:
poetry remove <package-name>
poetry add <package-name>==<version>
poetry add "<package-name> >= <version>"
poetry add <package-name>==<version>
poetry update <package-name>
Locking the Project
- To update the existing poetry.lock
file, thereby locking the project to ensure consistent dependency installation across different environments:
poetry lock
poetry add <pkg>==<version>
instead.
Installing Dependencies - To install project dependencies as per the lock file:
poetry install
poetry install -E spark
A comprehensive list of Poetry commands is available in the Poetry documentation.
Automating Virtual Environment Creation¶
To streamline the creation of a virtual environment via venv
, you may use the create_venv.sh script.
This script facilitates the automatic setup of a virtual environment, with the default environment name being venv.
Default Environment Creation:
source scripts/create_venv.sh
Specifying a Custom Environment Name:
source scripts/create_venv.sh <name_of_venv>