poetry icon indicating copy to clipboard operation
poetry copied to clipboard

Missing locale dev dependencies are reported although installend without dev

Open cgu-cmf opened this issue 8 months ago • 0 comments

Description

I have a poetry project which is using local python packages as dev dependencies, which therefore are part of the lock file. When I deploy the project using docker, these dev dependencies folders are ofc missing. This leads to a continues error message about the missing packages, although I don't need them in the container and also do not install that group at all.

This sounds like primary an inconvenience, but it also messed with execution of poetry commands using poethepoet. See this docker file on how we setup the container.

FROM python:3.11-slim AS base
ENV TZ=Europe/Berlin \
    VIRTUAL_ENV=/app/.venv \
    PATH="/app/.venv/bin:$PATH" \
    PYTHONPATH="/app:$PYTHONPATH" \
    DJANGO_STATIC_ROOT="/app/static" \
    DOMAIN_NAME="127.0.0.1" \
    DEBIAN_FRONTEND=noninteractive\
    POETRY_VIRTUALENVS_IN_PROJECT=1 \
    POETRY_NO_INTERACTION=1 \
    POETRY_VIRTUALENVS_CREATE=1

RUN apt-get update && apt-get upgrade -y && apt-get install -y \
    nano \
    tzdata \
    gettext 
RUN pip install poetry
WORKDIR /app
COPY pyproject.toml poetry.lock /app/
RUN poetry install --no-root --without dev
COPY . .
RUN poetry sync --only main

I did not test this if you use the build artifacts for the actual deployment, maybe this would circumvent this issue.

Workarounds

before running poetry sync ... run a poetry remove ... of the dev dependencies

Poetry Installation Method

pip

Operating System

Ubuntu 24.04.2

Poetry Version

2.0.1

Poetry Configuration

Path /app/pytest-history for pytest-history does not exist
cache-dir = "/root/.cache/pypoetry"
data-dir = "/root/.local/share/pypoetry"
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
installer.parallel = true
installer.re-resolve = true
keyring.enabled = true
python.installation-dir = "{data-dir}/python"  # /root/.local/share/pypoetry/python
requests.max-retries = 0
solver.lazy-wheel = true
system-git-client = false
virtualenvs.create = true
virtualenvs.in-project = true
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  # /root/.cache/pypoetry/virtualenvs
virtualenvs.prompt = "{project_name}-py{python_version}"
virtualenvs.use-poetry-python = false

Python Sysconfig

default config as provided by python:3.11-slim docker container

Example pyproject.toml

[tool.poetry]
name = "poetry-report-example"
version = "0.1.0"
description = ""
authors = ["Christian Günther <[email protected]>"]
readme = "README.md"


[tool.poetry.dependencies]
python = "^3.11"
pandas = "^2.3.0"


[tool.poetry.group.dev.dependencies]
my-local-dev-package = {path = "my-local-dev-package"}

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

Poetry Runtime Logs

poetry-runtime.log

Path /app/pytest-history for pytest-history does not exist Loading configuration file /root/.config/pypoetry/config.toml Using virtualenv: /app/.venv Checking keyring availability: Checking if keyring is available [keyring:keyring.backend] Loading KWallet [keyring:keyring.backend] Loading SecretService [keyring:keyring.backend] Loading Windows [keyring:keyring.backend] Loading chainer [keyring:keyring.backend] Loading libsecret [keyring:keyring.backend] Loading macOS Backend 'fail Keyring' is not suitable No valid keyring backend was found Unavailable Installing dependencies from lock file

Finding the necessary packages for the current system Path /app/pytest-history for pytest-history does not exist

Package operations: 0 installs, 0 updates, 0 removals, 6 skipped

  • Installing numpy (2.3.1): Pending...
  • Installing numpy (2.3.1): Skipped for the following reason: Already installed
  • Installing pandas (2.3.1): Pending...
  • Installing pandas (2.3.1): Skipped for the following reason: Already installed
  • Installing python-dateutil (2.9.0.post0): Pending...
  • Installing python-dateutil (2.9.0.post0): Skipped for the following reason: Already installed
  • Installing pytz (2025.2): Pending...
  • Installing pytz (2025.2): Skipped for the following reason: Already installed
  • Installing six (1.17.0): Pending...
  • Installing six (1.17.0): Skipped for the following reason: Already installed
  • Installing tzdata (2025.2): Pending...
  • Installing tzdata (2025.2): Skipped for the following reason: Already installed

Installing the current project: poetry-report-example (0.1.0)

  • Building package poetry-report-example in editable mode
Paste the output of 'poetry -vvv <command>', over this line.

cgu-cmf avatar Jul 09 '25 10:07 cgu-cmf