Skip to content

Installing and managing dependencies

A Lime CRM project has a number of first and third party dependencies. To install and manage them we use a tool called Poetry.

Poetry is a tool for managing dependencies and virtual environments, as well as building and publishing your Python packages. It serves as a modern replacement for pip, making the development experience easier. This quick start guide provides the basics of using poetry for working with Lime packages and solutions.

The official documentation for poetry lives here:


Poetry provides a custom installer that will install poetry isolated from the rest of your system by vendorizing its dependencies. This is the recommended way of installing poetry. We're using Poetry version 1.0.10. Please use the script below to install it:

curl -sSL | python - --version 1.0.10

If poetry has been installed with pip or pipx, please uninstall it or remove it from your path.


You should install poetry version 1.0.10 as the latest is not supported.

To ensure that you install poetry 1.0.10 use poetry self update 1.0.10 for existing poetry installations.

Poetry is installed into the user's platform-specific home directory. Test your installation by running:

poetry --version

For configuring poetry, refer to

pyproject.toml file

Poetry uses a single standardized pyproject.toml file to replace, requirements.txt, setup.cfg,, and Pipfile.

This file is used to store all your metadata and dependency declarations.

Dependencies and dev-dependencies are declared in their corresponding sections tool.poetry.dependencies and of the pyproject.toml file.

For newly created solutions using lime-project, the file will look similar to this:

requires      = ['poetry>=0.12']
build-backend = 'poetry.masonry.api'

display_name  = ''
package_name  = 'solution-test'
lib_name      = 'solution_test'

name        = 'solution-test'
version     = '0.1.0'
description = 'Lime CRM solution'
authors     = ['Author <[email protected]>']

    name = 'lime'
    url  = ''

    'solution-test' = 'solution_test'

    python   = '~3.7.3'
    lime-crm = ">=1.3.1, <3"

    autopep8 = '>=1'
    pytest   = '^5'
    flake8   = '^3'

    project_version = '1.26.0-poetry.1'
    project_type    = 'solution'

The lime-crm dependency

Each project always has a dependency on lime-crm, the underlying library for Lime CRM. A package should keep as broad range of versions as its dependencies, while a solution should narrow it down.

On-premise releases

Each Lime CRM Server on-premise release has a specific version of the library lime-crm included. To enable a matching release, you need to specify the correct version of lime-crm in your pyproject.toml file, e.g.:

lime-crm = "==1.6.1"

In the list of released on-premise versions, the version of the lime-crm can be found in parentheses of the version number.


Lime CRM 2020.2.245 (2.22.2) is built against lime-crm==2.22.2 as implied in the version number

Set up poetry to use our own PyPi

We have our own server for hosting python packages at By default, poetry won't know about this server unless you tell it.

Configuring poetry to use the Lime PyPI

poetry config repositories.lime
poetry config http-basic.lime [PYPI USERNAME HERE] [PYPI PASSWORD HERE] 


this is only needed the first time you install and set up Poetry

You can explicitly tell poetry to search for packages on our own server by adding the following to the pyproject.toml file of your project:

name = "lime"
url = ""


This entry is auto-generated when creating or migrating a solution using lime-project.

Adding dependencies

Dependencies are added running

$ poetry add [dependency]

For more information regarding options and dependency specification please see Poetry's documentation

Managing dependencies

Project dependencies must be locked in a file called poetry.lock before your project is published to the remote repo. This is done by running:

$ poetry lock

Once dependencies are lock, all following installs will use the lock-file to install dependencies. To update any dependency run:

$ poetry update [dependency]


Without the poetry.lock file will fail to build when pushed to the master branch.

Dependencies can be installed from the poetry.lock file by running:

$ poetry install


If you don't have a lock-file, running poetry install will create one

For more info on managing dependencies, refer to

Back to top