italia/spid-testenv2

Update markupsafe to 1.1 in requirements.txt

niciz opened this issue · 4 comments

niciz commented

Durante la build del Dockerfile si ottiene questo errore:

Building spidtest
Step 1/10 : FROM python:3.5-slim
---> 6c1acaa52013
Step 2/10 : RUN apt-get update && apt-get install -y ca-certificates xmlsec1 libffi6 && apt-get clean && rm -rf /var/lib/apt/lists/*
---> Using cache
---> 64b8780b571c
Step 3/10 : COPY ./requirements.txt /app/requirements.txt
---> Using cache
---> 9b14b37e0e55
Step 4/10 : WORKDIR /app
---> Using cache
---> 014c9efa2a12
Step 5/10 : RUN pip install -r requirements.txt
---> Running in ca86b6046a78
Collecting asn1crypto==0.24.0
Downloading asn1crypto-0.24.0-py2.py3-none-any.whl (101 kB)
Collecting certifi==2018.10.15
Downloading certifi-2018.10.15-py2.py3-none-any.whl (146 kB)
Collecting cffi==1.11.5
Downloading cffi-1.11.5-cp35-cp35m-manylinux1_x86_64.whl (420 kB)
Collecting chardet==3.0.4
Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting click==7.0
Downloading Click-7.0-py2.py3-none-any.whl (81 kB)
Collecting cryptography==2.3.1
Downloading cryptography-2.3.1-cp34-abi3-manylinux1_x86_64.whl (2.1 MB)
Collecting defusedxml==0.5.0
Downloading defusedxml-0.5.0-py2.py3-none-any.whl (33 kB)
Collecting eight==0.4.2
Downloading eight-0.4.2-py2.py3-none-any.whl (9.9 kB)
Collecting exrex==0.10.5
Downloading exrex-0.10.5.tar.gz (4.8 kB)
Collecting faker==0.8.16
Downloading Faker-0.8.16-py2.py3-none-any.whl (742 kB)
Collecting flask-admin==1.5.1
Downloading Flask-Admin-1.5.1.tar.gz (1.6 MB)
Collecting flask-sqlalchemy==2.3.2
Downloading Flask_SQLAlchemy-2.3.2-py2.py3-none-any.whl (16 kB)
Collecting flask==1.0.2
Downloading Flask-1.0.2-py2.py3-none-any.whl (91 kB)
Collecting future==0.16.0
Downloading future-0.16.0.tar.gz (824 kB)
Collecting idna==2.7
Downloading idna-2.7-py2.py3-none-any.whl (58 kB)
Collecting importlib-resources==1.0.1
Downloading importlib_resources-1.0.1-py2.py3-none-any.whl (31 kB)
Collecting itsdangerous==1.1.0
Downloading itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)
Collecting jinja2==2.10.3
Downloading Jinja2-2.10.3-py2.py3-none-any.whl (125 kB)
Collecting lxml==4.2.3
Downloading lxml-4.2.3-cp35-cp35m-manylinux1_x86_64.whl (5.8 MB)
Collecting markupsafe==1.0
Downloading MarkupSafe-1.0.tar.gz (14 kB)
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-c1224212/markupsafe/setup.py'"'"'; file='"'"'/tmp/pip-install-c1224212/markupsafe/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-hpc22f7i
cwd: /tmp/pip-install-c1224212/markupsafe/
Complete output (5 lines):
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-c1224212/markupsafe/setup.py", line 6, in
from setuptools import setup, Extension, Feature
ImportError: cannot import name 'Feature'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Service 'spidtest' failed to build: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1
make: *** [up_production] Error 1

SOLUZIONE:
Upgrade to markupsafe:1.1
pallets/markupsafe#57

Ciao io ho risolto modificando Dockerfile ;

FROM python:3.4

RUN apt-get update && apt-get install -y ca-certificates xmlsec1 libffi6
&& apt-get clean
&& rm -rf /var/lib/apt/lists/*

COPY ./requirements.txt /app/requirements.txt
WORKDIR /app
RUN /usr/local/bin/python -m pip install --upgrade pip
RUN pip install -r requirements.txt

COPY . /app

EXPOSE 8088
VOLUME /app/conf

ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["python", "spid-testenv.py"]

niciz commented

Ciao @antonioluzzi
Io non farei il downgrade a phyton 3.4.
Meglio fare l'upgrade dei requirements con markupsafe:1.1

A me non ha causato problemi.

ciao, non avevo visto le ultime due righe del tuo post. Pardon me.

ok qui

markupsafe==1.1.1 # via jinja2