Poetry
@Didayolo
, @bbearce
Question 1
In the project we have these two files:
pyproject.toml
poetry.lock
When I want to update a package, I should update pyproject.toml
right?
Question 2
In the Dockerfile
the specified python version is 3.9
but in pyproject.toml
it is ^3.10. Is this inconsistent or on purpose?
Question 3
In the Dockerfile
we have these lines:
COPY pyproject.toml ./
COPY poetry.lock ./
RUN poetry install
This means we are copying pyproject.toml
and poetry.lock
. Will RUN poetry install
regenerate the lock file?
I am asking these because I am updating a package bpython
in pyproject.toml
and I am rebuilding the django container which gives me this error:
[+] Building 2.9s (13/14)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 32B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 34B 0.0s
=> [internal] load metadata for docker.io/library/python:3.9 2.1s
=> [auth] library/python:pull token for registry-1.docker.io 0.0s
=> [1/9] FROM docker.io/library/python:3.9@sha256:47d6f16aa0de11f2748c73e7af8d40eaf44146c6dc059b1d0aa1f917f8c5cc58 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 1.78kB 0.0s
=> CACHED [2/9] RUN apt-get update && apt-get install -y gcc build-essential && rm -rf /var/lib/apt/lists/* 0.0s
=> CACHED [3/9] RUN curl -sSL https://install.python-poetry.org | python3 - 0.0s
=> CACHED [4/9] RUN poetry config virtualenvs.create false 0.0s
=> CACHED [5/9] RUN poetry config virtualenvs.in-project false 0.0s
=> [6/9] COPY pyproject.toml ./ 0.0s
=> [7/9] COPY poetry.lock ./ 0.0s
=> ERROR [8/9] RUN poetry install 0.7s
------
> [8/9] RUN poetry install:
#0 0.383 The currently activated Python version 3.9.19 is not supported by the project (^3.10).
#0 0.383 Trying to find and use a compatible version.
#0 0.420 Using python3.11 (3.11.2)
#0 0.421 Skipping virtualenv creation, as specified in config file.
#0 0.490 Installing dependencies from lock file
#0 0.634
#0 0.634 pyproject.toml changed significantly since poetry.lock was last generated. Run `poetry lock [--no-update]` to fix the lock file.
------
failed to solve: executor failed running [/bin/sh -c poetry install]: exit code: 1
(base) ihsanullah@Pixel-io codabench %