Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Poetry for dependency management? #601

Closed
osma opened this issue Aug 4, 2022 · 0 comments · Fixed by #605
Closed

Switch to Poetry for dependency management? #601

osma opened this issue Aug 4, 2022 · 0 comments · Fixed by #605
Assignees
Milestone

Comments

@osma
Copy link
Member

osma commented Aug 4, 2022

At the moment, we are using setuptools and Pip to manage dependencies, which are defined in setup.py. In the past we used Pipenv, but it was abandoned due to many problems in PR #405. Poetry is very similar to Pipenv and one of the core features is that it manages virtual environments.

Here are some of the potential benefits of using Poetry for Annif:

  1. Simplify development installation (hopefully), for example Poetry handles the creation of virtual environments which currently has to be done manually.
  2. Move package metadata to a standardized (PEP 518) pyproject.toml file, instead of the current executable setup.py.
  3. Make it easier to manage dependencies and discover which libraries need updating. Poetry provides commands like poetry update (update dependencies to latest versions within the current constraints), poetry show --outdated (show available versions of dependencies, also outside the current constraints) and poetry show --tree (show the dependencies as a tree). These are a hassle in the current setup and/or require installing external tools.

There are of course potential downsides as well - the change could be disruptive to developers, who need to learn new habits. CI jobs and documentation (mainly the top level README) need to be updated. There's always a risk of unwanted side effects and unexpected problems.

One detail: Poetry documentation recommends that the poetry.lock file should be stored under version control. However, I don't think that's a good idea for Annif for several reasons: we support multiple Python versions in parallel (and potentially multiple platforms) which may lead to different versions of packages being installed in different situations, it's a recipe for merge conflicts etc. So I think we should put poetry.lock in .gitignore instead and try to ensure that declared dependencies are strict enough. See also this SO answer with similar arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants