Installation fails with 'Key "metadata" does not exist.' error.
See original GitHub issue-
I am on the latest Poetry version.
-
I have searched the issues of this repo and believe that this is not a duplicate.
-
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option). -
OS version and name: Docker version
20.10.12
, builde91ed57
withpython:3.8.10
image. Host system:ubuntu 20.04
-
Poetry version: 1.1.13
-
pyproject.toml:
[tool.poetry]
name = "localpg"
version = "0.1.0"
description = ""
authors = ["José Castagnino"]
packages = [{include = "localpg"}]
[tool.poetry.dependencies]
python = "3.8.10"
pandas = "^1.3.5"
alembic = "^1.7.5"
muttlib = "1.4.12"
python-decouple = "^3.5"
pangres = "^3.0"
psycopg2 = "^2.9.3"
[tool.poetry.dev-dependencies]
black = "^21.12b0"
pdbpp = "^0.10.3"
pylint = "^2.12.2"
isort = "^5.10.1"
flake8 = "^4.0.1"
pre-commit-hooks = "^4.1.0"
mypy = "^0.931"
[tool.black]
line_length = 88
skip-string-normalization = true
[tool.mypy]
ignore_missing_imports = true
follow_imports = 'skip'
[tool.isort]
multi_line_output = 3
line_length = 88
include_trailing_comma = true
[tool.pylint.master]
jobs = 0
[tool.pylint.'MESSAGES CONTROL']
disable = [
'C',
'R',
'fixme',
'logging-format-interpolation',
'logging-fstring-interpolation',
'unspecified-encoding'
]
[tool.pylint.'FORMAT']
max-line-length = 88 # as in black
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Issue
I’m trying to build a custom docker image with my python app using python:3.8.10
as a base image and the following Dockerfile
:
FROM python:3.8.10
RUN apt-get update \
&& apt-get install -y neovim \
&& apt-get install -y --no-install-recommends gcc git \
&& apt-get install --no-install-recommends --no-install-suggests --assume-yes curl
ENV PATH="/root/.local/bin:$PATH"
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
RUN . $HOME/.poetry/env
ENV PATH="${PATH}:/root/.poetry/bin"
COPY pyproject.toml /silico-local-pg/pyproject.toml
WORKDIR /silico-local-pg
RUN poetry config virtualenvs.create false
RUN poetry install --no-root
COPY . /silico-local-pg
RUN poetry install --no-interaction
Everything seems to go ok until the very last command poetry install --no-interaction
. I keep getting
NonExistentKey
'Key "metadata" does not exist.'
at ~/.poetry/lib/poetry/_vendor/py3.8/tomlkit/container.py:553 in __getitem__
549│ key = Key(key)
550│
551│ idx = self._map.get(key, None)
552│ if idx is None:
→ 553│ raise NonExistentKey(key)
554│
555│ if isinstance(idx, tuple):
556│ # The item we are getting is an out of order table
557│ # so we need a proxy to retrieve the proper objects
The command '/bin/sh -c poetry install --no-interaction' returned a non-zero code: 1
My project has the following structure
silico-local-pg
|_/localpg
|_<my python source code>
|_/docker
|_Dockerfile
|_pyproject.toml
|_poetry.lock
Please let me know of any additional information I might have missed and feel free to close if this is a duplicate or not related to poetry.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
The lockfile was indeed messed up, most likely by me when copying it into the
docker
directory to make it available at build time. After deleting it and regenerating it without using docker, I ended up moving the dockerfile instead so they all live in the same directory (repo’s root).I believe this was a combination of both myself messing up and the docker build context being a PITA to configure.
In any case I’ll be closing this, thanks for your help @clintonroy
very random guess, due to permisisons it’s not being written and is being seen as empty or some such.