Skip to content

'EmptyConstraint' object has no attribute 'allows' #4402

@asifali22

Description

@asifali22

Everything was working fine until yesterday, I cleaned up my docker ending up removing all the images, etc. The project was building fine before clean up. Post clean up when I rebuilt the docker image, I started receiving the error:

 Writing lock file
#11 68.00
#11 68.00 [AttributeError]
#11 68.00 'EmptyConstraint' object has no attribute 'allows'
#11 68.00
#11 68.05 Traceback (most recent call last):
#11 68.05   File "/usr/local/lib/python3.8/site-packages/clikit/console_application.py", line 131, in run
#11 68.05     status_code = command.handle(parsed_args, io)
#11 68.05   File "/usr/local/lib/python3.8/site-packages/clikit/api/command/command.py", line 120, in handle
#11 68.05     status_code = self._do_handle(args, io)
#11 68.05   File "/usr/local/lib/python3.8/site-packages/clikit/api/command/command.py", line 171, in _do_handle
#11 68.05     return getattr(handler, handler_method)(args, io, self)
#11 68.05   File "/usr/local/lib/python3.8/site-packages/cleo/commands/command.py", line 92, in wrap_handle
#11 68.05     return self.handle()
#11 68.05   File "/usr/local/lib/python3.8/site-packages/poetry/console/commands/update.py", line 49, in handle
#11 68.05     return installer.run()
#11 68.05   File "/usr/local/lib/python3.8/site-packages/poetry/installation/installer.py", line 74, in run
#11 68.05     self._do_install(local_repo)
#11 68.05   File "/usr/local/lib/python3.8/site-packages/poetry/installation/installer.py", line 230, in _do_install
#11 68.05     self._filter_operations(ops, local_repo)
#11 68.05   File "/usr/local/lib/python3.8/site-packages/poetry/installation/installer.py", line 447, in _filter_operations
#11 68.05     ) or not self._env.is_valid_for_marker(package.marker):
#11 68.05   File "/usr/local/lib/python3.8/site-packages/poetry/utils/env.py", line 808, in is_valid_for_marker
#11 68.05     return marker.validate(self.marker_env)
#11 68.05   File "/usr/local/lib/python3.8/site-packages/poetry/version/markers.py", line 601, in validate
#11 68.05     if m.validate(environment):
#11 68.05   File "/usr/local/lib/python3.8/site-packages/poetry/version/markers.py", line 470, in validate
#11 68.05     if not m.validate(environment):
#11 68.05   File "/usr/local/lib/python3.8/site-packages/poetry/version/markers.py", line 361, in validate
#11 68.05     return self._constraint.allows(self._parser(environment[self._name]))
#11 68.05

Here's my .toml file:

[tool.poetry]
name = "myproject"
version = "0.1.0"
description = ""
authors = ["abc <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.8"
python-dotenv = "^0.17.0"
numpy = ">=1.19.2"
pandas = "^1.2.4"
Flask = "^1.1.2"
Flask-SQLAlchemy = "^2.5.1"
Flask-Migrate = "^2.7.0"
newrelic = "^6.2.0"
python-jose = "^3.2.0"
Flask-JWT = "^0.3.2"
PyMySQL = "^1.0.2"
psycopg2 = "^2.8.6"
toolz = "^0.11.1"
sortedcontainers = "^2.3.0"
sqlalchemy-redshift = "^0.8.2"
boto3 = "^1.17.57"
joblib = "^1.0.1"
xgboost = "^1.4.2"
scikit-learn = "^0.24.2"
redis = "^3.5.3"
celery = {extras = ["redis"], version = "^5.1.0"}

[tool.poetry.dev-dependencies]

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

And here's my dockerfile:

FROM tiangolo/uwsgi-nginx-flask:python3.8

LABEL MAINTAINER="[email protected]>"

ARG APP_DIR=/zest-srv
ARG SERVICE_NAME=service
ARG LOG_DIR_PATH=/var/log/uwsgi

WORKDIR $APP_DIR

RUN apt-get update \
     && apt-get install -y ca-certificates

ARG POETRY_VERSION=1.0.0

## Use this instead
# curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -

RUN pip install poetry==$POETRY_VERSION
RUN poetry --version
COPY poetry.lock pyproject.toml ${APP_DIR}/
RUN poetry update -vvv

# RUN mkdir ${APP_DIR}/lib
# COPY lib/transportstore-0.1.0-py3-none-any.whl ${APP_DIR}/lib/

RUN poetry config virtualenvs.create false \
    && poetry install --no-interaction --no-ansi

Here the debug logs: https://pastebin.com/sbiiDf8Z

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions