python-poetry

Poetry add dependency that uses cython

Poetry add dependency that uses cython Question: I have a project which needs to depend on the latest commit of pysam, because I’m working in python 3.11. This means building the package from source, so I do the following: poetry add git+https://github.com/pysam-developers/pysam However, I get an error which I think boils down to poetry not …

Total answers: 1

Github Actions: poetry installs black but CI workflow does not find it

Github Actions: poetry installs black but CI workflow does not find it Question: I am setting up a python code quality workflow locally (pre-commit) and on Github Actions (GHA). Environment is managed with poetry. While the local precommit works fine, the remote GHA workflow fails, saying it does not find black, while looking at the …

Total answers: 1

How to use poetry in Google Colab?

How to use poetry in Google Colab? Question: Context I am currently working on a team project, where we need to train neural networks. Some members are working on their local computer, and some on Colab (for GPU usage). We need to have the same dependencies. I am already familiar in using poetry on a …

Total answers: 1

Python Docker SDK "Error while fetching server API version"

Python Docker SDK "Error while fetching server API version" Question: In the Python Docker SDK, When I do import docker docker.from_env() I see docker.errors.DockerException: Error while fetching server API version: (‘Connection aborted.’, FileNotFoundError(2, ‘No such file or directory’)) I have docker desktop running and this works in the terminal $ docker run -it ubuntu If …

Total answers: 1

Poetry add same library for different Python versions

Poetry add same library for different Python versions Question: I know how to add python constraint for a single library flake8 = { version = "^6.0.0", python = ">=3.8.1" } But what if I want to have same library, but different version for a different Python version? In case I add it with another constraint …

Total answers: 1

Get app version from pyproject.toml inside python code

Get app version from pyproject.toml inside python code Question: I am not very familiar with python, I only done automation with so I am a new with packages and everything. I am creating an API with Flask, Gunicorn and Poetry. I noticed that there is a version number inside the pyproject.toml and I would like …

Total answers: 2

Specifying Huggingface model as project dependency

Specifying Huggingface model as project dependency Question: Is it possible to install huggingface models as a project dependency? Currently it is downloaded automatically by the SentenceTransformer library, but this means in a docker container it downloads every time it starts. This is the model I am trying to use: https://huggingface.co/sentence-transformers/all-mpnet-base-v2 I have tried specifying the …

Total answers: 1

Poetry stuck in infinite install/update

Poetry stuck in infinite install/update Question: My issue is that when I execute poetry install, poetry update or poetry lock the process keeps running indefinitely. I tried using the -vvv flag to get output of what’s happening and it looks like it gets stuck forever in the first install. My connection is good and all …

Total answers: 2

Poetry creates a project with wrong Python version

Poetry creates a project with wrong Python version Question: I am attempting to create a poetry project with the latest version of Python install via my pyenv installation with homebrew. The below terminal commands show the versions of pyenv and poetry that I have. path/user % pyenv –version pyenv 2.3.9 path/user % pyenv versions system …

Total answers: 1

Downgrade poetry version

Downgrade poetry version Question: I need to downgrade my version of poetry to version 1.2.1. Currently, it’s 1.2.2. >>> poetry –version Poetry (version 1.2.2) I use the following command: >>> curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.2.1 python3 – Retrieving Poetry metadata The latest version (1.2.1) is already installed. But I’m told that 1.2.1 is already installed. …

Total answers: 3